Skip to content
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

[3.7] Import Protocol from typing_extensions (#5111) #5113

Merged
merged 1 commit into from
Oct 24, 2020

Conversation

asvetlov
Copy link
Member

Conditional imports must reference sys.version_info directly
for type checkers to be able to narrow them. If a type checker
cannot tell whether PY_38 is true, it will combine the imports
from both clauses in a Union.
However, typing.Protocol and typing_extensions.Protocol are
incompatible with each other - they do not inherit from the same class.
This produces a type error which is reported to users of aiohttp
depending on their type checking configuration..
(cherry picked from commit fb8037a)

Co-authored-by: layday 31134424+layday@users.noreply.github.com

Conditional imports must reference `sys.version_info` directly
for type checkers to be able to narrow them.  If a type checker
cannot tell whether `PY_38` is true, it will combine the imports
from both clauses in a `Union`.
However, `typing.Protocol` and `typing_extensions.Protocol` are
incompatible with each other - they do not inherit from the same class.
This produces a type error which is reported to users of aiohttp
depending on their type checking configuration..
(cherry picked from commit fb8037a)

Co-authored-by: layday <31134424+layday@users.noreply.github.com>
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 24, 2020
@asvetlov asvetlov merged commit 6c0a873 into 3.7 Oct 24, 2020
@asvetlov asvetlov deleted the backport-fb8037a-3.7 branch October 24, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants