MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / starred

Function starred

uncompyle6/semantics/customize36.py:726–754  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

724 # self.n_kwargs_only_36 = kwargs_only_36
725
726 def starred(node):
727 l = len(node)
728 assert l > 0
729 pos_args = node[0]
730 if pos_args == "expr":
731 pos_args = pos_args[0]
732 if pos_args == "tuple":
733 build_tuple = pos_args[0]
734 if build_tuple.kind.startswith("BUILD_TUPLE"):
735 tuple_len = 0
736 else:
737 tuple_len = len(node) - 1
738 star_start = 1
739 template = "%C", (0, -1, ", ")
740 self.template_engine(template, pos_args)
741 if tuple_len == 0:
742 self.write("*()")
743 # That's it
744 self.prune()
745 self.write(", ")
746 else:
747 star_start = 0
748 if l > 1:
749 template = ("*%C", (star_start, -1, ", *"))
750 else:
751 template = ("*%c", (star_start, "expr"))
752
753 self.template_engine(template, node)
754 self.prune()
755
756 self.n_starred = starred
757

Callers

nothing calls this directly

Calls 2

template_engineMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected