diff options
author | Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> | 2021-04-26 17:31:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-26 17:31:21 (GMT) |
commit | 1b1f9852bda85c01ef124858f293e9c13e04ffce (patch) | |
tree | 30b50ebb738a3a80ce5fff7f0b259af366774d48 /Lib/test/test_typing.py | |
parent | 94549ee728cd88d1ef053aab50da422f9e99b434 (diff) | |
download | cpython-1b1f9852bda85c01ef124858f293e9c13e04ffce.zip cpython-1b1f9852bda85c01ef124858f293e9c13e04ffce.tar.gz cpython-1b1f9852bda85c01ef124858f293e9c13e04ffce.tar.bz2 |
bpo-42904: Change search order of typing.get_type_hints eval (#25632)
While surprising (searching globals before locals in one specific case), this is needed for backwards compatibility.
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 99417d7..c28f390 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3016,10 +3016,10 @@ class GetTypeHintTests(BaseTestCase): {'other': MySet[T], 'return': MySet[T]} ) - def test_get_type_hints_classes(self): + def test_get_type_hints_classes_str_annotations(self): class Foo: y = str - x: y + x: 'y' # This previously raised an error under PEP 563. self.assertEqual(get_type_hints(Foo), {'x': str}) |