@@ -1432,16 +1432,16 @@ def test_repr_is_correct(self):
14321432 class G1 (Generic [* Ts ]): pass
14331433 class G2 (Generic [Unpack [Ts ]]): pass
14341434
1435- self .assertEqual (repr (Ts ), 'Ts' )
1435+ self .assertEqual (repr (Ts ), '~ Ts' )
14361436
1437- self .assertEqual (repr ((* Ts ,)[0 ]), 'typing.Unpack[Ts]' )
1438- self .assertEqual (repr (Unpack [Ts ]), 'typing.Unpack[Ts]' )
1437+ self .assertEqual (repr ((* Ts ,)[0 ]), 'typing.Unpack[~ Ts]' )
1438+ self .assertEqual (repr (Unpack [Ts ]), 'typing.Unpack[~ Ts]' )
14391439
1440- self .assertEqual (repr (tuple [* Ts ]), 'tuple[typing.Unpack[Ts]]' )
1441- self .assertEqual (repr (Tuple [Unpack [Ts ]]), 'typing.Tuple[typing.Unpack[Ts]]' )
1440+ self .assertEqual (repr (tuple [* Ts ]), 'tuple[typing.Unpack[~ Ts]]' )
1441+ self .assertEqual (repr (Tuple [Unpack [Ts ]]), 'typing.Tuple[typing.Unpack[~ Ts]]' )
14421442
1443- self .assertEqual (repr (* tuple [* Ts ]), '*tuple[typing.Unpack[Ts]]' )
1444- self .assertEqual (repr (Unpack [Tuple [Unpack [Ts ]]]), 'typing.Unpack[typing.Tuple[typing.Unpack[Ts]]]' )
1443+ self .assertEqual (repr (* tuple [* Ts ]), '*tuple[typing.Unpack[~ Ts]]' )
1444+ self .assertEqual (repr (Unpack [Tuple [Unpack [Ts ]]]), 'typing.Unpack[typing.Tuple[typing.Unpack[~ Ts]]]' )
14451445
14461446 def test_variadic_class_repr_is_correct (self ):
14471447 Ts = TypeVarTuple ('Ts' )
@@ -1480,61 +1480,61 @@ def test_variadic_class_alias_repr_is_correct(self):
14801480 class A (Generic [Unpack [Ts ]]): pass
14811481
14821482 B = A [* Ts ]
1483- self .assertEndsWith (repr (B ), 'A[typing.Unpack[Ts]]' )
1483+ self .assertEndsWith (repr (B ), 'A[typing.Unpack[~ Ts]]' )
14841484 self .assertEndsWith (repr (B [()]), 'A[()]' )
14851485 self .assertEndsWith (repr (B [float ]), 'A[float]' )
14861486 self .assertEndsWith (repr (B [float , str ]), 'A[float, str]' )
14871487
14881488 C = A [Unpack [Ts ]]
1489- self .assertEndsWith (repr (C ), 'A[typing.Unpack[Ts]]' )
1489+ self .assertEndsWith (repr (C ), 'A[typing.Unpack[~ Ts]]' )
14901490 self .assertEndsWith (repr (C [()]), 'A[()]' )
14911491 self .assertEndsWith (repr (C [float ]), 'A[float]' )
14921492 self .assertEndsWith (repr (C [float , str ]), 'A[float, str]' )
14931493
14941494 D = A [* Ts , int ]
1495- self .assertEndsWith (repr (D ), 'A[typing.Unpack[Ts], int]' )
1495+ self .assertEndsWith (repr (D ), 'A[typing.Unpack[~ Ts], int]' )
14961496 self .assertEndsWith (repr (D [()]), 'A[int]' )
14971497 self .assertEndsWith (repr (D [float ]), 'A[float, int]' )
14981498 self .assertEndsWith (repr (D [float , str ]), 'A[float, str, int]' )
14991499
15001500 E = A [Unpack [Ts ], int ]
1501- self .assertEndsWith (repr (E ), 'A[typing.Unpack[Ts], int]' )
1501+ self .assertEndsWith (repr (E ), 'A[typing.Unpack[~ Ts], int]' )
15021502 self .assertEndsWith (repr (E [()]), 'A[int]' )
15031503 self .assertEndsWith (repr (E [float ]), 'A[float, int]' )
15041504 self .assertEndsWith (repr (E [float , str ]), 'A[float, str, int]' )
15051505
15061506 F = A [int , * Ts ]
1507- self .assertEndsWith (repr (F ), 'A[int, typing.Unpack[Ts]]' )
1507+ self .assertEndsWith (repr (F ), 'A[int, typing.Unpack[~ Ts]]' )
15081508 self .assertEndsWith (repr (F [()]), 'A[int]' )
15091509 self .assertEndsWith (repr (F [float ]), 'A[int, float]' )
15101510 self .assertEndsWith (repr (F [float , str ]), 'A[int, float, str]' )
15111511
15121512 G = A [int , Unpack [Ts ]]
1513- self .assertEndsWith (repr (G ), 'A[int, typing.Unpack[Ts]]' )
1513+ self .assertEndsWith (repr (G ), 'A[int, typing.Unpack[~ Ts]]' )
15141514 self .assertEndsWith (repr (G [()]), 'A[int]' )
15151515 self .assertEndsWith (repr (G [float ]), 'A[int, float]' )
15161516 self .assertEndsWith (repr (G [float , str ]), 'A[int, float, str]' )
15171517
15181518 H = A [int , * Ts , str ]
1519- self .assertEndsWith (repr (H ), 'A[int, typing.Unpack[Ts], str]' )
1519+ self .assertEndsWith (repr (H ), 'A[int, typing.Unpack[~ Ts], str]' )
15201520 self .assertEndsWith (repr (H [()]), 'A[int, str]' )
15211521 self .assertEndsWith (repr (H [float ]), 'A[int, float, str]' )
15221522 self .assertEndsWith (repr (H [float , str ]), 'A[int, float, str, str]' )
15231523
15241524 I = A [int , Unpack [Ts ], str ]
1525- self .assertEndsWith (repr (I ), 'A[int, typing.Unpack[Ts], str]' )
1525+ self .assertEndsWith (repr (I ), 'A[int, typing.Unpack[~ Ts], str]' )
15261526 self .assertEndsWith (repr (I [()]), 'A[int, str]' )
15271527 self .assertEndsWith (repr (I [float ]), 'A[int, float, str]' )
15281528 self .assertEndsWith (repr (I [float , str ]), 'A[int, float, str, str]' )
15291529
15301530 J = A [* Ts , * tuple [str , ...]]
1531- self .assertEndsWith (repr (J ), 'A[typing.Unpack[Ts], *tuple[str, ...]]' )
1531+ self .assertEndsWith (repr (J ), 'A[typing.Unpack[~ Ts], *tuple[str, ...]]' )
15321532 self .assertEndsWith (repr (J [()]), 'A[*tuple[str, ...]]' )
15331533 self .assertEndsWith (repr (J [float ]), 'A[float, *tuple[str, ...]]' )
15341534 self .assertEndsWith (repr (J [float , str ]), 'A[float, str, *tuple[str, ...]]' )
15351535
15361536 K = A [Unpack [Ts ], Unpack [Tuple [str , ...]]]
1537- self .assertEndsWith (repr (K ), 'A[typing.Unpack[Ts], typing.Unpack[typing.Tuple[str, ...]]]' )
1537+ self .assertEndsWith (repr (K ), 'A[typing.Unpack[~ Ts], typing.Unpack[typing.Tuple[str, ...]]]' )
15381538 self .assertEndsWith (repr (K [()]), 'A[typing.Unpack[typing.Tuple[str, ...]]]' )
15391539 self .assertEndsWith (repr (K [float ]), 'A[float, typing.Unpack[typing.Tuple[str, ...]]]' )
15401540 self .assertEndsWith (repr (K [float , str ]), 'A[float, str, typing.Unpack[typing.Tuple[str, ...]]]' )
@@ -1555,9 +1555,9 @@ class G(type(Unpack[Ts])): pass
15551555 with self .assertRaisesRegex (TypeError ,
15561556 r'Cannot subclass typing\.Unpack' ):
15571557 class H (Unpack ): pass
1558- with self .assertRaisesRegex (TypeError , r'Cannot subclass typing.Unpack\[Ts\]' ):
1558+ with self .assertRaisesRegex (TypeError , r'Cannot subclass typing.Unpack\[~ Ts\]' ):
15591559 class I (* Ts ): pass
1560- with self .assertRaisesRegex (TypeError , r'Cannot subclass typing.Unpack\[Ts\]' ):
1560+ with self .assertRaisesRegex (TypeError , r'Cannot subclass typing.Unpack\[~ Ts\]' ):
15611561 class J (Unpack [Ts ]): pass
15621562
15631563 def test_variadic_class_args_are_correct (self ):
@@ -5506,13 +5506,13 @@ class TsP(Generic[*Ts, P]):
55065506 MyCallable [[int ], bool ]: "MyCallable[[int], bool]" ,
55075507 MyCallable [[int , str ], bool ]: "MyCallable[[int, str], bool]" ,
55085508 MyCallable [[int , list [int ]], bool ]: "MyCallable[[int, list[int]], bool]" ,
5509- MyCallable [Concatenate [* Ts , P ], T ]: "MyCallable[typing.Concatenate[typing.Unpack[Ts], ~P], ~T]" ,
5509+ MyCallable [Concatenate [* Ts , P ], T ]: "MyCallable[typing.Concatenate[typing.Unpack[~ Ts], ~P], ~T]" ,
55105510
55115511 DoubleSpec [P2 , P , T ]: "DoubleSpec[~P2, ~P, ~T]" ,
55125512 DoubleSpec [[int ], [str ], bool ]: "DoubleSpec[[int], [str], bool]" ,
55135513 DoubleSpec [[int , int ], [str , str ], bool ]: "DoubleSpec[[int, int], [str, str], bool]" ,
55145514
5515- TsP [* Ts , P ]: "TsP[typing.Unpack[Ts], ~P]" ,
5515+ TsP [* Ts , P ]: "TsP[typing.Unpack[~ Ts], ~P]" ,
55165516 TsP [int , str , list [int ], []]: "TsP[int, str, list[int], []]" ,
55175517 TsP [int , [str , list [int ]]]: "TsP[int, [str, list[int]]]" ,
55185518
0 commit comments