Skip to content

Commit 9592713

Browse files
committed
comment, some tweaks
1 parent 1fdb7c6 commit 9592713

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mypyc/irbuild/ll_builder.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ def _construct_varargs(self,
347347
348348
This is what really makes everything here such a tangle;
349349
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.)
350355
"""
351356

352357
star_result: Optional[Value] = None
@@ -455,6 +460,8 @@ def _construct_varargs(self,
455460

456461
seen_empty_reg = new_seen_empty_reg
457462

463+
assert not (star_result or star_values) or has_star
464+
assert not (star2_result or star2_values) or has_star2
458465
if has_star:
459466
# If we managed to make it this far without creating a
460467
# *args list, then we can directly create a
@@ -649,8 +656,7 @@ def native_args_to_positional(self,
649656
star_arg_entries = []
650657
for lst, arg in zip(formal_to_actual, sig.args):
651658
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)
654660
has_star = has_star or arg.kind == ARG_STAR
655661
has_star2 = has_star2 or arg.kind == ARG_STAR2
656662

0 commit comments

Comments
 (0)