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

Basic support for typing_extensions.Annotated. #7292

Merged
merged 2 commits into from
Aug 6, 2019
Merged

Basic support for typing_extensions.Annotated. #7292

merged 2 commits into from
Aug 6, 2019

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Aug 6, 2019

Closes #7021. This adds basic support for typing_extensions.Annotated. Currently, we just discard all annotations and resolve to the inner type.

Plugins can use get_type_analyze_hook to try to intervene before this step, but most of the arguments that aren't just names or Literal-able values will have already been mangled by this point. Nothing other than the type sees any sort of validation, either. See the issue discussion for more on this.

Copy link
Collaborator

@msullivan msullivan left a comment

Choose a reason for hiding this comment

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

Thanks! This looks great. We'll need to package up the expressions into a RawExpressionType like discussed in the issue before this is likely to be truly useful to things that actually want to use Annotated, but accepting it is an important first step.

@msullivan msullivan merged commit f67c3ee into python:master Aug 6, 2019
@brandtbucher brandtbucher deleted the annotated branch August 6, 2019 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for typing_extensions.Annotated
2 participants