Skip to content

Moved get_type_hints() to the 3.9 level#298

Merged
asottile merged 1 commit intoasottile:mainfrom
agronholm:patch-1
Sep 24, 2022
Merged

Moved get_type_hints() to the 3.9 level#298
asottile merged 1 commit intoasottile:mainfrom
agronholm:patch-1

Conversation

@agronholm
Copy link
Copy Markdown
Contributor

This function gained an extra parameter, "include_extras", in Python 3.9, and this parameter is provided by the typing_extensions implementation.

'typing_extensions=typing:TYPE_CHECKING',
'typing_extensions=typing:Text',
'typing_extensions=typing:Type',
'typing_extensions=typing:get_type_hints',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

please read the PR I linked you to and the comment directly above this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are you referring to a comment in the code, or a comment in the linked PR? Either way I'm not sure what you mean, but I did make one change I noticed that the linked PR did too.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

the comment in the code that says "this is generated" -- aka you shouldn't edit it manually

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've removed the changes to generated code.

@asottile
Copy link
Copy Markdown
Owner

you should change the generator, then run the generator, then put the generated code into the source

Comment on lines +471 to +476
REPLACES[(3, 11)].update((
'typing_extensions=typing:NamedTuple',
'typing_extensions=typing:TypedDict',
'typing_extensions=typing:final',
'typing_extensions=typing:overload',
))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

like the other PR -- can you remove this from the output until 3.11 final has landed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

This function gained an extra parameter, "include_extras", in Python 3.9, and this parameter is provided by the typing_extensions implementation.
Copy link
Copy Markdown
Owner

@asottile asottile left a comment

Choose a reason for hiding this comment

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

@asottile asottile merged commit 58fcb90 into asottile:main Sep 24, 2022
@agronholm agronholm deleted the patch-1 branch September 24, 2022 21:33
@agronholm
Copy link
Copy Markdown
Contributor Author

Thanks!

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.

2 participants