-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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.pyi imports Protocol
from typing.pyi rather than defining its own
#7130
Comments
I'm ok with changing this back; there wasn't really a compelling reason to merge the two. |
Apologies for causing the regression @erictraut (it was my PR IIRC). Seems like it should be added back to |
Until recently,
typing_extensions.pyi
declared its ownProtocol
symbol as follows:It now directly imports
Protocol
fromtyping.pyi
and re-exports this symbol. This means pyright can no longer differentiate between the two symbols. There's an important difference becausetyping.Protocol
will generate a runtime exception if used in versions of Python prior to 3.7, buttyping_extensions.Protocol
will not.@JelleZijlstra, is there a reason this change was made? Or put another way, is there a reason not to change it back?
Here's a link to bug that describes the regression in pyright: microsoft/pyright#2987
The text was updated successfully, but these errors were encountered: