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

Method visit

Lib/_ast_unparse.py:189–194  ·  view source on GitHub ↗

Outputs a source code string that, if converted back to an ast (using ast.parse) will generate an AST equivalent to *node*

(self, node)

Source from the content-addressed store, hash-verified

187 # NodeVisitor.generic_visit to handle any nodes (as it calls back in to
188 # the subclass visit() method, which resets self._source to an empty list)
189 def visit(self, node):
190 """Outputs a source code string that, if converted back to an ast
191 (using ast.parse) will generate an AST equivalent to *node*"""
192 self._source = []
193 self.traverse(node)
194 return "".join(self._source)
195
196 def _write_docstring_and_traverse_body(self, node):
197 if (docstring := self.get_raw_docstring(node)):

Callers 2

traverseMethod · 0.45

Calls 2

traverseMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected