mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix type annotation of ast.NodeTransformer.generic_visit(). It always returns an ast.ASt object. (#4483)
This commit is contained in:
@@ -144,7 +144,7 @@ class NodeVisitor:
|
||||
def visit_Ellipsis(self, node: Ellipsis) -> Any: ...
|
||||
|
||||
class NodeTransformer(NodeVisitor):
|
||||
def generic_visit(self, node: AST) -> Optional[AST]: ...
|
||||
def generic_visit(self, node: AST) -> AST: ...
|
||||
# TODO: Override the visit_* methods with better return types.
|
||||
# The usual return type is Optional[AST], but Iterable[AST]
|
||||
# is also allowed in some cases -- this needs to be mapped.
|
||||
|
||||
Reference in New Issue
Block a user