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

Method fill

Lib/_ast_unparse.py:94–102  ·  view source on GitHub ↗

Indent a piece of text and append it, according to the current indentation level, or only delineate with semicolon if applicable

(self, text="", *, allow_semicolon=True)

Source from the content-addressed store, hash-verified

92 self.write("; ")
93
94 def fill(self, text="", *, allow_semicolon=True):
95 """Indent a piece of text and append it, according to the current
96 indentation level, or only delineate with semicolon if applicable"""
97 if self._in_interactive and not self._indent and allow_semicolon:
98 self.maybe_semicolon()
99 self.write(text)
100 else:
101 self.maybe_newline()
102 self.write(" " * self._indent + text)
103
104 def write(self, *text):
105 """Add new source parts"""

Callers 15

visit_ExprMethod · 0.95
visit_ImportMethod · 0.95
visit_ImportFromMethod · 0.95
visit_AssignMethod · 0.95
visit_AugAssignMethod · 0.95
visit_AnnAssignMethod · 0.95
visit_ReturnMethod · 0.95
visit_PassMethod · 0.95
visit_BreakMethod · 0.95
visit_ContinueMethod · 0.95
visit_DeleteMethod · 0.95
visit_AssertMethod · 0.95

Calls 3

maybe_semicolonMethod · 0.95
writeMethod · 0.95
maybe_newlineMethod · 0.95

Tested by

no test coverage detected