@@ -1318,6 +1318,11 @@ def test_infer_variance(self):
13181318 def test_bound (self ):
13191319 Ts_bound = TypeVarTuple ('Ts_bound' , bound = int )
13201320 self .assertIs (Ts_bound .__bound__ , int )
1321+ Ts_tuple_bound = TypeVarTuple ('Ts_tuple_bound' , bound = (int , str ))
1322+ self .assertEqual (Ts_tuple_bound .__bound__ , (int , str ))
1323+ obj = object ()
1324+ Ts_object = TypeVarTuple ('Ts_object' , bound = obj )
1325+ self .assertIs (Ts_object .__bound__ , obj )
13211326 Ts_no_bound = TypeVarTuple ('Ts_no_bound' )
13221327 self .assertIsNone (Ts_no_bound .__bound__ )
13231328
@@ -10565,6 +10570,17 @@ def test_paramspec_in_nested_generics(self):
1056510570 self .assertEqual (G2 [[int , str ], float ], list [C ])
1056610571 self .assertEqual (G3 [[int , str ], float ], list [C ] | int )
1056710572
10573+ def test_paramspec_bound (self ):
10574+ P = ParamSpec ('P' , bound = [int , str ])
10575+ self .assertEqual (P .__bound__ , [int , str ])
10576+ P2 = ParamSpec ('P2' , bound = (int , str ))
10577+ self .assertEqual (P2 .__bound__ , (int , str ))
10578+ obj = object ()
10579+ P3 = ParamSpec ('P3' , bound = obj )
10580+ self .assertIs (P3 .__bound__ , obj )
10581+ P4 = ParamSpec ('P4' )
10582+ self .assertIs (P4 .__bound__ , None )
10583+
1056810584 def test_paramspec_gets_copied (self ):
1056910585 # bpo-46581
1057010586 P = ParamSpec ('P' )
0 commit comments