You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that there is no way to create error-free type for Enums of primitive Python types. E.g., the following code leads to the following error: 'Item "str" of "Literal['x32'] | IWordSizeEnum32" has no attribute "value" Mypy[union-attr]'
topic: featureDiscussions about new features for Python's type annotations
1 participant
Converted from issue
This discussion was converted from issue #1521 on December 04, 2023 13:53.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It seems that there is no way to create error-free type for Enums of primitive Python types. E.g., the following code leads to the following error: 'Item "str" of "Literal['x32'] | IWordSizeEnum32" has no attribute "value" Mypy[union-attr]'
Should 'Literal' add '.value' and '.name' for a 'enum.property'?
Beta Was this translation helpful? Give feedback.
All reactions