-
-
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
Unexpected error behaviour: Parameterized generics cannot be used with class or instance checks #12155
Comments
Interesting. float64 is defined here: https://github.com/numpy/numpy/blob/51abd9693a78907f2ca7dfacee2017ef44fb9f49/numpy/__init__.pyi#L2973. It's obviously meant as a type alias, but apparently mypy sometimes interprets it as a variable assignment. |
I have the same issue with Unions version:
Config:
Code
Result:
Code works fine Thank you! Edit:
This passes both code and check, but does not work as a type guard Edit 2:
|
Any status update? Note that |
I'm also wondering about the status on this. |
Should this have the label |
Any new development on mitigating this. |
Fixes python#12155 and probably several duplicates
mypy
reports success forbut fails for
with the error
fails.py:3: error: Parameterized generics cannot be used with class or instance checks
I'm using
mypy
(0.931) andnumpy
(1.22.2).Why do I get different results?
The text was updated successfully, but these errors were encountered: