File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -799,12 +799,12 @@ def _construct_varargs(
799
799
# fn(*args)
800
800
if is_list_rprimitive (value .type ):
801
801
value = self .primitive_op (list_tuple_op , [value ], line )
802
- elif not is_tuple_rprimitive (value .type ):
802
+ elif not is_tuple_rprimitive (value .type ) and not isinstance ( value . type , RTuple ) :
803
803
value = self .primitive_op (sequence_tuple_op , [value ], line )
804
804
return value , self ._create_dict ([], [], line )
805
805
elif len (args ) == 2 and args [1 ][1 ] == ARG_STAR2 :
806
806
# fn(*args, **kwargs)
807
- if is_tuple_rprimitive (value .type ):
807
+ if is_tuple_rprimitive (value .type ) or isinstance ( value . type , RTuple ) :
808
808
star_result = value
809
809
elif is_list_rprimitive (value .type ):
810
810
star_result = self .primitive_op (list_tuple_op , [value ], line )
Original file line number Diff line number Diff line change @@ -1674,22 +1674,20 @@ def g():
1674
1674
r0 :: tuple[int, int, int]
1675
1675
r1 :: dict
1676
1676
r2 :: str
1677
- r3, r4 :: object
1678
- r5 :: tuple
1679
- r6 :: dict
1680
- r7 :: object
1681
- r8 :: tuple[int, int, int]
1677
+ r3 :: object
1678
+ r4 :: dict
1679
+ r5, r6 :: object
1680
+ r7 :: tuple[int, int, int]
1682
1681
L0:
1683
1682
r0 = (2, 4, 6)
1684
1683
r1 = __main__.globals :: static
1685
1684
r2 = 'f'
1686
1685
r3 = CPyDict_GetItem(r1, r2)
1687
- r4 = box(tuple[int, int, int], r0)
1688
- r5 = PySequence_Tuple(r4)
1689
- r6 = PyDict_New()
1690
- r7 = PyObject_Call(r3, r5, r6)
1691
- r8 = unbox(tuple[int, int, int], r7)
1692
- return r8
1686
+ r4 = PyDict_New()
1687
+ r5 = box(tuple[int, int, int], r0)
1688
+ r6 = PyObject_Call(r3, r5, r4)
1689
+ r7 = unbox(tuple[int, int, int], r6)
1690
+ return r7
1693
1691
def h():
1694
1692
r0 :: tuple[int, int]
1695
1693
r1 :: dict
You can’t perform that action at this time.
0 commit comments