Skip to content

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Jul 17, 2021

This fixes TypedDict to work with get_type_hints and postponed evaluation of annotations across modules.

This is done by adding the module name to ForwardRef at the time the object is created and using that to resolve the globals during the evaluation.

Co-authored-by: Ken Jin [email protected]
(cherry picked from commit 889036f)

Co-authored-by: Germán Méndez Bravo [email protected]

https://bugs.python.org/issue41249

This fixes TypedDict to work with get_type_hints and postponed evaluation of annotations across modules.

This is done by adding the module name to ForwardRef at the time the object is created and using that to resolve the globals during the evaluation.

Co-authored-by: Ken Jin <[email protected]>
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.

Yeah!

@gvanrossum
Copy link
Member

Oh wait, test_typing failed!

@ambv ambv merged commit fa674bd into python:3.9 Jul 17, 2021
@Fidget-Spinner Fidget-Spinner deleted the backport-41249-3.9 branch July 17, 2021 09:37
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.

6 participants