Potential bug: Never
as invariant type-var
#4891
Azureblade3808
started this conversation in
General
Replies: 1 comment
-
Thanks, I agree this is a bug. It will be addressed in the next release. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Look at this --
It is expected that every assignment in
f
gets reported asT
is invariant andNever
is a different type fromobject
orint
. Mypy is giving a correct result: https://mypy-play.net/?mypy=latest&python=3.12&gist=f14c91ed1eb6b2bbf31153ccf8fd0d45 .If the type-var is changed into co-variant or contra-variant, the result will be correct accordingly.
I haven't thought of a practical case affected by this yet, but maybe it's worth some check.
Beta Was this translation helpful? Give feedback.
All reactions