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

Method pp_tuple

uncompyle6/semantics/pysource.py:532–555  ·  view source on GitHub ↗

Pretty print a tuple

(self, tup)

Source from the content-addressed store, hash-verified

530 )
531
532 def pp_tuple(self, tup):
533 """Pretty print a tuple"""
534 last_line = self.f.getvalue().split("\n")[-1]
535 ll = len(last_line) + 1
536 indent = " " * ll
537 self.write("(")
538 sep = ""
539 for item in tup:
540 self.write(sep)
541 ll += len(sep)
542 s = better_repr(item, self.version)
543 ll += len(s)
544 self.write(s)
545 sep = ","
546 if ll > LINE_LENGTH:
547 ll = 0
548 sep += "\n" + indent
549 else:
550 sep += " "
551 pass
552 pass
553 if len(tup) == 1:
554 self.write(", ")
555 self.write(")")
556
557 # Python changes make function this much that we need at least 3 different routines,
558 # and probably more in the future.

Callers 1

n_LOAD_CONSTMethod · 0.80

Calls 2

writeMethod · 0.95
better_reprFunction · 0.90

Tested by

no test coverage detected