Skip to content

Simplify Protocol import #39

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

Closed
tekktrik opened this issue Sep 27, 2022 · 0 comments · Fixed by #40
Closed

Simplify Protocol import #39

tekktrik opened this issue Sep 27, 2022 · 0 comments · Fixed by #40
Labels

Comments

@tekktrik
Copy link
Member

The typical try/except typing block has an inner one that attempts to import Protocol from the typing module, but imports it from typing_extensions as a fallback. The typing_extensions module already attempts to import typing.Protocol anyways.

Therefore, this can be changed to a simple from typing_extensions import Protocol within the typing try/except block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants