MCPcopy
hub / github.com/python/mypy / visit

Method visit

mypy/fastparse.py:416–426  ·  view source on GitHub ↗
(self, node: AST | None)

Source from the content-addressed store, hash-verified

414 )
415
416 def visit(self, node: AST | None) -> Any:
417 if node is None:
418 return None
419 typeobj = type(node)
420 visitor = self.visitor_cache.get(typeobj)
421 if visitor is None:
422 method = "visit_" + node.__class__.__name__
423 visitor = getattr(self, method)
424 self.visitor_cache[typeobj] = visitor
425
426 return visitor(node)
427
428 def set_line(self, node: N, n: AstNode) -> N:
429 node.line = n.lineno

Callers 15

translate_stmt_listMethod · 0.95
make_argumentMethod · 0.95
visit_ClassDefMethod · 0.95
visit_ReturnMethod · 0.95
visit_DeleteMethod · 0.95
visit_AssignMethod · 0.95
visit_AnnAssignMethod · 0.95
visit_AugAssignMethod · 0.95
visit_ForMethod · 0.95
visit_AsyncForMethod · 0.95
visit_WhileMethod · 0.95

Calls 3

typeClass · 0.85
getattrFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected