Skip to content

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