@@ -5326,6 +5326,16 @@ class ProtoZ(Protocol[P]):
53265326 G10args = G10 .__args__ [0 ] if sys .version_info >= (3 , 10 ) else G10 .__args__
53275327 self .assertEqual (G10args , (int , Concatenate [str , P ], ))
53285328
5329+ @skipUnless (TYPING_3_10_0 , "ParamSpec not present before 3.10" )
5330+ def test_is_param_expr (self ):
5331+ P = ParamSpec ("P" )
5332+ P_typing = typing .ParamSpec ("P_typing" )
5333+ self .assertTrue (typing_extensions ._is_param_expr (P ))
5334+ self .assertTrue (typing_extensions ._is_param_expr (P_typing ))
5335+ if hasattr (typing , "_is_param_expr" ):
5336+ self .assertTrue (typing ._is_param_expr (P ))
5337+ self .assertTrue (typing ._is_param_expr (P_typing ))
5338+
53295339 def test_single_argument_generic_with_parameter_expressions (self ):
53305340 P = ParamSpec ("P" )
53315341 T = TypeVar ("T" )
@@ -5571,6 +5581,17 @@ def test_eq(self):
55715581 self .assertNotEqual (C4 , C6 )
55725582
55735583
5584+ @skipUnless (TYPING_3_10_0 , "Concatenate not present before 3.10" )
5585+ def test_is_param_expr (self ):
5586+ P = ParamSpec ('P' )
5587+ concat = Concatenate [str , P ]
5588+ typing_concat = typing .Concatenate [str , P ]
5589+ self .assertTrue (typing_extensions ._is_param_expr (concat ))
5590+ self .assertTrue (typing_extensions ._is_param_expr (typing_concat ))
5591+ if hasattr (typing , "_is_param_expr" ):
5592+ self .assertTrue (typing ._is_param_expr (concat ))
5593+ self .assertTrue (typing ._is_param_expr (typing_concat ))
5594+
55745595class TypeGuardTests (BaseTestCase ):
55755596 def test_basics (self ):
55765597 TypeGuard [int ] # OK
0 commit comments