File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -668,10 +668,13 @@ def test_or_type_operator_with_TypeVar(self):
668668
669669 def test_union_parameter_chaining (self ):
670670 T = typing .TypeVar ("T" )
671+ S = typing .TypeVar ("S" )
671672
672673 self .assertEqual ((float | list [T ])[int ], float | list [int ])
673674 self .assertEqual (list [int | list [T ]].__parameters__ , (T ,))
674675 self .assertEqual (list [int | list [T ]][str ], list [int | list [str ]])
676+ self .assertEqual ((list [T ] | list [S ]).__parameters__ , (T , S ))
677+ self .assertEqual ((list [T ] | list [S ])[int , T ], list [int ] | list [T ])
675678
676679 def test_or_type_operator_with_forward (self ):
677680 T = typing .TypeVar ('T' )
Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ static PyObject *
443443union_getitem (PyObject * self , PyObject * item )
444444{
445445 unionobject * alias = (unionobject * )self ;
446- // do a lookup for __parameters__ so it gets populated ( if not already)
446+ // Populate __parameters__ if needed.
447447 if (alias -> parameters == NULL ) {
448448 alias -> parameters = _Py_make_parameters (alias -> args );
449449 if (alias -> parameters == NULL ) {
You can’t perform that action at this time.
0 commit comments