Skip to content

Commit dfea9a6

Browse files
authored
Document visit method return type (#13831)
1 parent 893eabe commit dfea9a6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/ast.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,8 +1893,12 @@ if sys.version_info >= (3, 14):
18931893
def compare(left: AST, right: AST, /, *, compare_attributes: bool = False) -> bool: ...
18941894

18951895
class NodeVisitor:
1896+
# All visit methods below can be overwritten by subclasses and return an
1897+
# arbitrary value, which is passed to the caller.
18961898
def visit(self, node: AST) -> Any: ...
18971899
def generic_visit(self, node: AST) -> Any: ...
1900+
# The following visit methods are not defined on NodeVisitor, but can
1901+
# be implemented by subclasses and are called during a visit if defined.
18981902
def visit_Module(self, node: Module) -> Any: ...
18991903
def visit_Interactive(self, node: Interactive) -> Any: ...
19001904
def visit_Expression(self, node: Expression) -> Any: ...

0 commit comments

Comments
 (0)