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):
668
668
669
669
def test_union_parameter_chaining (self ):
670
670
T = typing .TypeVar ("T" )
671
+ S = typing .TypeVar ("S" )
671
672
672
673
self .assertEqual ((float | list [T ])[int ], float | list [int ])
673
674
self .assertEqual (list [int | list [T ]].__parameters__ , (T ,))
674
675
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 ])
675
678
676
679
def test_or_type_operator_with_forward (self ):
677
680
T = typing .TypeVar ('T' )
Original file line number Diff line number Diff line change @@ -443,7 +443,7 @@ static PyObject *
443
443
union_getitem (PyObject * self , PyObject * item )
444
444
{
445
445
unionobject * alias = (unionobject * )self ;
446
- // do a lookup for __parameters__ so it gets populated ( if not already)
446
+ // Populate __parameters__ if needed.
447
447
if (alias -> parameters == NULL ) {
448
448
alias -> parameters = _Py_make_parameters (alias -> args );
449
449
if (alias -> parameters == NULL ) {
You can’t perform that action at this time.
0 commit comments