Document visit method return type (#13831)

This commit is contained in:
Sebastian Rittau
2025-04-15 18:09:33 +02:00
committed by GitHub
parent 893eabe4ce
commit dfea9a6a26
+4
View File
@@ -1893,8 +1893,12 @@ if sys.version_info >= (3, 14):
def compare(left: AST, right: AST, /, *, compare_attributes: bool = False) -> bool: ...
class NodeVisitor:
# All visit methods below can be overwritten by subclasses and return an
# arbitrary value, which is passed to the caller.
def visit(self, node: AST) -> Any: ...
def generic_visit(self, node: AST) -> Any: ...
# The following visit methods are not defined on NodeVisitor, but can
# be implemented by subclasses and are called during a visit if defined.
def visit_Module(self, node: Module) -> Any: ...
def visit_Interactive(self, node: Interactive) -> Any: ...
def visit_Expression(self, node: Expression) -> Any: ...