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

Method delimit_if

Lib/_ast_unparse.py:141–145  ·  view source on GitHub ↗
(self, start, end, condition)

Source from the content-addressed store, hash-verified

139 self.write(end)
140
141 def delimit_if(self, start, end, condition):
142 if condition:
143 return self.delimit(start, end)
144 else:
145 return nullcontext()
146
147 def require_parens(self, precedence, node):
148 """Shortcut to adding precedence related parens"""

Callers 4

require_parensMethod · 0.95
visit_AnnAssignMethod · 0.95
visit_ClassDefMethod · 0.95
visit_TupleMethod · 0.95

Calls 2

delimitMethod · 0.95
nullcontextClass · 0.90

Tested by

no test coverage detected