-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Underspecified type variables should not infer UninhabitedType #3032
Comments
(Sorry, heavily edited... it's more complex than I thought.) AFAIU, the rule for inferring the type of lvalue in an assignment is intended to be roughly this:
I think the problem is that mypy sometimes ends up not doing step 3, instead leaving That said, I don't completely understand step 2, since the "lowest" type may not exist; but I hope the rest of my comments are still correct. |
Unconstrained TypeVars should not infer UninhabitedType as the result -- it leads to confusing behavior.
(See:
testUnderspecifiedInferenceResult
)The text was updated successfully, but these errors were encountered: