-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
type not generic when running with Python < 3.9 #10303
Comments
@JukkaL This doesn't seem to fixed in mypy 0.930:
(I tested it with both Python 3.9.6 and 3.6.14.) |
Interestingly, it appears to be fixed for from __future__ import annotations
foo: type[str] But this, in a foo: type[str] Many similar errors can be found in the CI output for python/typeshed#6681. |
Cc. @sobolevn |
Sorry, I cannot not reopen issues, but here's my PR: #11863 |
Thanks to sobolevn this should be fixed for pyi with old Pythons! |
Bug Report
Please consider the following stub file:
When checking it with mypy 0.820+dev.1e96f1df48a6e06ba598fa8230b96671b206cba0 and Python 3.9.4, it passes. Using Python 3.8.9 on the other hand, produces the following output:
It's weird that generic
dict
works, but generictype
doesn't. (Although I'd expect both to work with any Python version.)This came up during python/typeshed#5192.
The text was updated successfully, but these errors were encountered: