Skip to content

Reuse stdlib PEP 593 implementation in typing_extensions if present #699

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

Merged
merged 1 commit into from
Feb 11, 2020

Conversation

jstasiak
Copy link
Contributor

@jstasiak jstasiak commented Feb 6, 2020

Following [1] this prevents multiple runtime implementations of Annotated
and get_type_hints from existing on Python 3.9 (which has recently
merged PEP 593 changes[2]). Reexporting allows code targetting both
Python pre-3.9 and 3.9+ to be able to import from typing_extensions and
to keep working without changes.

_AnnotatedAlias import is needed for #698 to work.

[1] python/cpython#18260 (comment)
[2] python/cpython#18260

Following [1] this prevents multiple runtime implementations of Annotated
and get_type_hints from existing on Python 3.9 (which has recently
merged PEP 593 changes[2]). Reexporting allows code targetting both
Python pre-3.9 and 3.9+ to be able to import from typing_extensions and
to keep working without changes.

[1] python/cpython#18260 (comment)
[2] python/cpython#18260
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for #698.

@gvanrossum gvanrossum merged commit f3e77b4 into python:master Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants