mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-10-21 04:57:03 +08:00
Fix type annotation of ast.NodeTransformer.generic_visit(). It always returns an ast.ASt object. (#4483)
This commit is contained in:
1 parent
5f9fd3d127
commit
cfe832b907
1 file changed
+1
-1
+1
-1
@@ -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