-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
mypy thinks value is <nothing>
when it isn't
#15793
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
Comments
<nothing>
when it clearly isn't<nothing>
when it isn't
The code sample contains a bug. The It may be a good idea for mypy to emit an error when a type variable is used in an incorrect manner like this. There was a discussion about this in the typing forums a while back. If I remember correctly, the authors of pyright, pytype and pyre all decided to add such an error (or warning), but mypy does not emit an error in this case. |
I don't think that is the issue here. Edited to return
but this still fails:
|
Mypy believes that it is impossible for an
isinstance
to succeed if the known type has a generic and the subtype has specified that generic.To Reproduce
Expected Behavior
Mypy should have no problems with this code
Actual Behavior
Your Environment
mypy FILE
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: