File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -790,12 +790,15 @@ def _construct_varargs(
790790 if star_result is None :
791791 # fast path if star expr is a tuple:
792792 # we can pass the immutable tuple straight into the function call.
793- if is_tuple_rprimitive (value .type ) and (
794- len (args ) == 1 or (len (args ) == 2 and args [1 ][1 ] == ARG_STAR2 )
795- ): # only matches fn(*args) and fn(*args, **kwargs)
793+ if is_tuple_rprimitive (value .type ):
794+ if len (args ) == 1 :
795+ # fn(*args)
796+ return value , None
797+ elif len (args ) == 2 and args [1 ][1 ] == ARG_STAR2 :
798+ # fn(*args, **kwargs)
799+ star_result = value
800+ continue
796801 # TODO extend this to optimize fn(*args, k=1, **kwargs) case
797- star_result = value
798- continue
799802 else :
800803 # TODO optimize this case using the length utils - currently in review
801804 star_result = self .new_list_op (star_values , line )
You can’t perform that action at this time.
0 commit comments