mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #28649: fix-typing-test-v2.diff
This commit is contained in:
parent
991d14fee1
commit
f9099de894
1 changed files with 4 additions and 3 deletions
|
@ -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, ...])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue