@@ -5384,7 +5384,7 @@ def test_invalid_uses(self):
53845384 Concatenate [P , T ]
53855385
53865386 # Cannot construct a Callable with Ellipsis in 3.8 as args must be types
5387- if sys .version_info [: 2 ] >= (3 , 9 , 2 ):
5387+ if sys .version_info >= (3 , 9 , 2 ):
53885388 with self .assertRaisesRegex (
53895389 TypeError ,
53905390 'is not a generic class' ,
@@ -5404,16 +5404,16 @@ def test_invalid_uses(self):
54045404 ):
54055405 Concatenate [1 , ..., P ]
54065406
5407- @skipUnless (TYPING_3_11_0 , "Cannot be backported to <=3.9"
5408- "Cannot use ... with 3.10 typing._ConcatenateGenericAlias" )
5407+ @skipUnless (TYPING_3_11_0 or (3 , 10 , 0 ) <= sys .version_info < (3 , 10 , 2 ),
5408+ "Cannot be backported to <=3.9"
5409+ "Cannot use ... with 3.10.2+ typing._ConcatenateGenericAlias" )
54095410 def test_alias (self ):
5410- P = ParamSpec ("P" )
5411- C1 = Callable [Concatenate [int , P ], Any ]
5412- # Python <= 3.9 fails because parameters to generic types must be types.
5413- # For Python 3.10 & typing._ConcatenateGenericAlias will
5414- # as Ellipsis is not supported for ParamSpec
5415- # Fallback to 3.10 & typing_extensions._ConcatenateGenericAlias not implemented
5416- C1 [...]
5411+ P = ParamSpec ('P' )
5412+ X = Callable [Concatenate [int , P ], Any ]
5413+
5414+ C1 = X [...]
5415+ self .assertEqual (C1 .__parameters__ , ())
5416+ self .assertEqual (C1 .__args__ , (Concatenate [int , ...], Any ))
54175417
54185418 def test_basic_introspection (self ):
54195419 P = ParamSpec ('P' )
0 commit comments