-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Mypy and Pyright complain when importing new NamedTuple #56
Comments
I forgot to add it to the typeshed stub for It might be worth noting, however, that mypy doesn't yet support generic |
Great, thanks! |
@AlexWaygood I see the fix was merged. I think the typeshed CI pipeline already ran too since then. How do I get this stub into my env? Thanks. |
You have to wait for the next mypy or pyright release. We can probably get this into mypy 0.970 (expected soon), and pyright releases with updated stubs frequently. |
In the meantime, if you're using mypy, one option is to clone typeshed's master branch and use mypy with the |
Great thanks both! |
Hi,
I am trying to use generic
NamedTuple
from the newtyping_extensions
, however static checkers can't resolve its import.Below is the code to reproduce and
mypy
errors as comments.Not sure what the problem is. I see that there's a conditional here that checks for Python 3.11. It might be the case that type checkers can't resolve this statically. This is just a hypothesis though.
Environment
Python 3.8.10
The text was updated successfully, but these errors were encountered: