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
In this code, the frozen dataclass shows different inference behavior when providing explicit type hints on the left hand side of the assignment. This has caused me quite some confusion. I don't know if this is a bug or somehow "expected" according to inference rules.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
pyright 1.1.407In this code, the frozen dataclass shows different inference behavior when providing explicit type hints on the left hand side of the assignment. This has caused me quite some confusion. I don't know if this is a bug or somehow "expected" according to inference rules.
For reference, mypy infers
Union[Literal['a'], Literal['b'], Literal['c']]in all casesBeta Was this translation helpful? Give feedback.
All reactions