@@ -347,6 +347,11 @@ def _construct_varargs(self,
347
347
348
348
This is what really makes everything here such a tangle;
349
349
otherwise the *args and **kwargs code could be separated.
350
+
351
+ The arguments has_star and has_star2 indicate whether the target function
352
+ takes an ARG_STAR and ARG_STAR2 argument, respectively.
353
+ (These will always be true when making a pycall, and be based
354
+ on the actual target signature for a native call.)
350
355
"""
351
356
352
357
star_result : Optional [Value ] = None
@@ -455,6 +460,8 @@ def _construct_varargs(self,
455
460
456
461
seen_empty_reg = new_seen_empty_reg
457
462
463
+ assert not (star_result or star_values ) or has_star
464
+ assert not (star2_result or star2_values ) or has_star2
458
465
if has_star :
459
466
# If we managed to make it this far without creating a
460
467
# *args list, then we can directly create a
@@ -649,8 +656,7 @@ def native_args_to_positional(self,
649
656
star_arg_entries = []
650
657
for lst , arg in zip (formal_to_actual , sig .args ):
651
658
if arg .kind .is_star ():
652
- for i in lst :
653
- star_arg_entries .append ((args [i ], arg_kinds [i ], arg_names [i ]))
659
+ star_arg_entries .extend ((args [i ], arg_kinds [i ], arg_names [i ]) for i in lst )
654
660
has_star = has_star or arg .kind == ARG_STAR
655
661
has_star2 = has_star2 or arg .kind == ARG_STAR2
656
662
0 commit comments