-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Error using typing_extensions.Protocol with Python 3.6 #2987
Comments
It contains a regression¹ that reports errors about using Protocol from typing_extensions on Python 3.6. If you have pyright pre-installed locally (instead of just-in-time installed via npx), manually downgrade to pyright 1.1.216 to avoid spurious errors. ¹ microsoft/pyright#2987
The problem here is that I'll need to ask the maintainers of typeshed why they made this change and see if they're willing to revert it. |
I submitted the change to the typeshed repo. It has been merged, and I updated pyright's copy of the typeshed stubs accordingly, so this will be fixed in the next release. |
This is addressed in pyright 1.1.219, which I just published. It will also be in the next release of pylance. |
@erictraut Thank you! |
Describe the bug
pyright 1.1.217 (installed from NPM) incorrectly reports
Use of "Protocol" requires Python 3.7 or newer
when analyzing for Python 3.6 and importingProtocol
fromtyping_extensions
.To Reproduce
With the code below saved in
example.py
, run:Expected behavior
importing
Protocol
fromtyping_extensions
should not trigger an error.Screenshots or Code
VS Code extension or command-line
pyright 1.1.217 from NPM.
Additional context
Regression of a previously fixed bug: #763
The text was updated successfully, but these errors were encountered: