This repository has been archived by the owner on Dec 27, 2021. It is now read-only.
forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stdlib/3/ast: add visit_* methods to NodeVisitor (python#3796)
NodeVisitor recurses over an AST tree. When encountering a node, it checks if a method called `visit_{node.__class__.__name__}` exists, and calls it if so, otherwise calls the generic visitor. Add the possible methods to NodeVisitor. This is not exactly correct, since the methods don't *actually* exist on NodeVisitor, e.g. `NodeVisitor().visit_Module(...)` doesn't work. But it's nice for subclasses to know which methods they can override and which type they should have.
- Loading branch information
Showing
5 changed files
with
230 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters