-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Description
Using mypy 0.761, Python 3.7.5 here. The ANIMALS2 value is highlighted as incorrect by Mypy:
COW: Literal['cow'] = 'cow'
PIG: Literal['pig'] = 'pig'
ANIMALS1: Literal['cow', 'pig'] # This is OK
ANIMALS2: Literal[COW, PIG]
# ^^^^^^^ Mypy: Parameter 1 of Literal[...] is invalidBut it seems Mypy should be able to deduce that ANIMALS1 and ANIMALS2 are the same thing?
I'm not sure if the more lax version should be allowed as well, but seems useful:
OX = 'ox'
ANIMALS = Literal[OX]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels