From f9099de8949af434eacb905680849ec3ac41348a Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 9 Nov 2016 13:18:59 -0800 Subject: [PATCH] Issue #28649: fix-typing-test-v2.diff --- Lib/test/test_typing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index ae9de612739..05828459c6b 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -743,10 +743,11 @@ class GenericTests(BaseTestCase): self.assertEqual(repr(Callable[[], List[T]][int]).replace('typing.', ''), 'Callable[[], List[int]]') - def test_generic_forvard_ref(self): - def foobar(x: List[List['T']]): ... + def test_generic_forward_ref(self): + def foobar(x: List[List['CC']]): ... + class CC: ... + self.assertEqual(get_type_hints(foobar, globals(), locals()), {'x': List[List[CC]]}) T = TypeVar('T') - self.assertEqual(get_type_hints(foobar, globals(), locals()), {'x': List[List[T]]}) def barfoo(x: Tuple[T, ...]): ... self.assertIs(get_type_hints(barfoo, globals(), locals())['x'], Tuple[T, ...])