File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1605,7 +1605,10 @@ def func1(*args: *Ts): pass
1605
1605
self .assertEqual (gth (func1 ), {'args' : Unpack [Ts ]})
1606
1606
1607
1607
def func2 (* args : * tuple [int , str ]): pass
1608
- self .assertEqual (gth (func2 ), {'args' : Unpack [tuple [int , str ]]})
1608
+ hint = gth (func2 )['args' ]
1609
+ self .assertIsInstance (hint , types .GenericAlias )
1610
+ self .assertEqual (hint .__args__ [0 ], int )
1611
+ self .assertIs (hint .__unpacked__ , True )
1609
1612
1610
1613
class CustomVariadic (Generic [* Ts ]): pass
1611
1614
@@ -1620,7 +1623,10 @@ def func1(*args: '*Ts'): pass
1620
1623
{'args' : Unpack [Ts ]})
1621
1624
1622
1625
def func2 (* args : '*tuple[int, str]' ): pass
1623
- self .assertEqual (gth (func2 ), {'args' : Unpack [tuple [int , str ]]})
1626
+ hint = gth (func2 )['args' ]
1627
+ self .assertIsInstance (hint , types .GenericAlias )
1628
+ self .assertEqual (hint .__args__ [0 ], int )
1629
+ self .assertIs (hint .__unpacked__ , True )
1624
1630
1625
1631
class CustomVariadic (Generic [* Ts ]): pass
1626
1632
You can’t perform that action at this time.
0 commit comments