-
-
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
typing_extensions TypeVar seems to be unsupported #14312
Comments
This should be an easy fix if you're up for it. For inspiration, you can look at the commit adding support for |
I would be happy to contribute, but it seems that this approach would just alias My actual usage (not from example) relies on |
Yes, that would be much harder. :) I think @Gobot1234 already has a draft implementation of PEP 696 for mypy. |
https://github.com/Gobot1234/mypy/tree/TypeVar-defaults is my draft implementation of PEP 696, its not bug free and is more lax than the current specification but it should work for most basic things. |
I opened #14313 to add basic support for the @Gobot1234 Would you be able to rebase your |
This PR only adds the existing `TypeVar` support for the `typing_extensions` variant. I.e. it does not include support for `default` or `infer_variance`. Fixes #14312
@cdce8p should be done now, not sure how out of sync everything is, it sure does look like a lot changed |
Bug Report
Mypy doesn't support
typing_extensions.TypeVar
at allTo Reproduce
Playground
Expected Behavior
This code should work fine (importing
TypeVar
fromtyping
works, but my actual use case depends ondefault
argument ofTypeVar
, so I can't usetyping.TypeVar
)Actual Behavior
Your Environment
mypy Playground, latest mypy (0.991)
The text was updated successfully, but these errors were encountered: