@@ -1316,6 +1316,11 @@ def test_infer_variance(self):
13161316 def test_bound (self ):
13171317 Ts_bound = TypeVarTuple ('Ts_bound' , bound = int )
13181318 self .assertIs (Ts_bound .__bound__ , int )
1319+ Ts_tuple_bound = TypeVarTuple ('Ts_tuple_bound' , bound = (int , str ))
1320+ self .assertEqual (Ts_tuple_bound .__bound__ , (int , str ))
1321+ obj = object ()
1322+ Ts_object = TypeVarTuple ('Ts_object' , bound = obj )
1323+ self .assertIs (Ts_object .__bound__ , obj )
13191324 Ts_no_bound = TypeVarTuple ('Ts_no_bound' )
13201325 self .assertIsNone (Ts_no_bound .__bound__ )
13211326
@@ -10534,6 +10539,17 @@ def test_paramspec_in_nested_generics(self):
1053410539 self .assertEqual (G2 [[int , str ], float ], list [C ])
1053510540 self .assertEqual (G3 [[int , str ], float ], list [C ] | int )
1053610541
10542+ def test_paramspec_bound (self ):
10543+ P = ParamSpec ('P' , bound = [int , str ])
10544+ self .assertEqual (P .__bound__ , [int , str ])
10545+ P2 = ParamSpec ('P2' , bound = (int , str ))
10546+ self .assertEqual (P2 .__bound__ , (int , str ))
10547+ obj = object ()
10548+ P3 = ParamSpec ('P3' , bound = obj )
10549+ self .assertIs (P3 .__bound__ , obj )
10550+ P4 = ParamSpec ('P4' )
10551+ self .assertIs (P4 .__bound__ , None )
10552+
1053710553 def test_paramspec_gets_copied (self ):
1053810554 # bpo-46581
1053910555 P = ParamSpec ('P' )
0 commit comments