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
If you try to widdle down the type of a generic class in a certain manner, it only works if you use an intermediate variable. A little tough to explain without looking at the example
Now mypy shows errors in both cases which is at least more consistent. First example used to work by accident, mypy doesn't support dependencies between expressions in general (except few common cases).
Bug Report
If you try to widdle down the type of a generic class in a certain manner, it only works if you use an intermediate variable. A little tough to explain without looking at the example
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.10&gist=d3ebef88a57147cef8a8d311e1b33fb7
Expected Behavior
Both
get_a_does_work
andget_a_should_work
should pass type checking.Actual Behavior
get_a_should_work
outouts:main.py:20: error: Incompatible return value type (got "None", expected "T")
Your Environment
You can see on the playground
The text was updated successfully, but these errors were encountered: