MCPcopy
hub / github.com/pallets/jinja / get_visitor

Method get_visitor

src/jinja2/visitor.py:28–33  ·  view source on GitHub ↗

Return the visitor function for this node or `None` if no visitor exists for this node. In that case the generic visit function is used instead.

(self, node: Node)

Source from the content-addressed store, hash-verified

26 """
27
28 def get_visitor(self, node: Node) -> "t.Optional[VisitCallable]":
29 """Return the visitor function for this node or `None` if no visitor
30 exists for this node. In that case the generic visit function is
31 used instead.
32 """
33 return getattr(self, f"visit_{type(node).__name__}", None)
34
35 def visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
36 """Visit a node."""

Callers 1

visitMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected