MCPcopy Index your code
hub / github.com/python/cpython / items_view

Method items_view

Lib/_ast_unparse.py:74–82  ·  view source on GitHub ↗

Traverse and separate the given *items* with a comma and append it to the buffer. If *items* is a single item sequence, a trailing comma will be added.

(self, traverser, items)

Source from the content-addressed store, hash-verified

72 f(x)
73
74 def items_view(self, traverser, items):
75 """Traverse and separate the given *items* with a comma and append it to
76 the buffer. If *items* is a single item sequence, a trailing comma
77 will be added."""
78 if len(items) == 1:
79 traverser(items[0])
80 self.write(",")
81 else:
82 self.interleave(lambda: self.write(", "), traverser, items)
83
84 def maybe_newline(self):
85 """Adds a newline if it isn't the start of generated source"""

Callers 3

visit_ConstantMethod · 0.95
visit_TupleMethod · 0.95
visit_SubscriptMethod · 0.95

Calls 2

writeMethod · 0.95
interleaveMethod · 0.95

Tested by

no test coverage detected