-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Changed typing_extensions.pyi to declare its own private version of Protocol
#7133
Changed typing_extensions.pyi to declare its own private version of Protocol
#7133
Conversation
…Protocol` rather than re-exporting the symbol imported from `typing`. This allows pyright to warn users about runtime exceptions when they attempt to use typing.Protocol on versions of Python prior to 3.7.
This is related to issue #7130 |
Should the changes #7037 made to |
This comment has been minimized.
This comment has been minimized.
Pyright doesn't currently have a version check for |
This comment has been minimized.
This comment has been minimized.
I'm easy either way if it doesn't break pyright :) I vote for leaving it as it is in that case — it keeps code duplication to a minimum |
Actually I'd prefer we change it too, so that any type checker that does want to error for use of |
@JelleZijlstra, I've reverted the recent change for |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Changed typing_extensions.pyi to declare its own private version of
Protocol
rather than re-exporting the symbol imported fromtyping
. This allows pyright to warn users about runtime exceptions when they attempt to use typing.Protocol on versions of Python prior to 3.7.