-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-119562: Remove AST nodes deprecated since Python 3.8 #119563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -508,27 +508,6 @@ def generic_visit(self, node): | |||
elif isinstance(value, AST): | |||
self.visit(value) | |||
|
|||
def visit_Constant(self, node): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh I think you accidentally removed this. Above said to use this. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I deliberately removed it. It will still work if you define visit_Constant
on a custom subclass of ast.NodeVisitor
. The reason why it is currently defined on ast.NodeVisitor
itself — uniquely among the visit_*
methods — is to ensure that the deprecated methods visit_Num
, visit_Str
, etc. continue to work if you define them on a subclass of ast.NodeVisitor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to clarify this a bit in 40b5965 -- hopefully that helps!
Fixes #119562
📚 Documentation preview 📚: https://cpython-previews--119563.org.readthedocs.build/