I would like to do the following:
from typing import Union, Literal
YES = 1
NO = 0
ValidResponse = Union[Literal[YES], Literal[NO]]
Of course, Python won't let me do this because YES and NO are considered to be variables, not literal numbers.
Obviously I can do ValidResponse = Union[Literal[1], Literal[0]], but as a programmer editing this file later, it seems odd that in order to change what constant YES used (for example YES = 'yes'), I would need to change it in two different places.
What's the best way to handle this scenario?