{{ message }}
[3.9] bpo-41249: Fix postponed annotations for TypedDict (GH-27017)#27205
Merged
ambv merged 2 commits intoJul 17, 2021
Merged
Conversation
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 <28750310+Fidget-Spinner@users.noreply.github.com>
gvanrossum
approved these changes
Jul 17, 2021
gvanrossum
left a comment
Member
There was a problem hiding this comment.
Yeah!
Sorry, something went wrong.
Member
|
Oh wait, test_typing failed! |
Sorry, something went wrong.
ambv
reviewed
Jul 17, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
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 28750310+Fidget-Spinner@users.noreply.github.com
(cherry picked from commit 889036f)
Co-authored-by: Germán Méndez Bravo german.mb@gmail.com
https://bugs.python.org/issue41249