Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commented May 25, 2024

@AlexWaygoodAlexWaygood requested a review from hugovkMay 25, 2024 19:50
elif isinstance(value, AST):
self.visit(value)

def visit_Constant(self, node):
Copy link
Contributor

@AraHaanAraHaanMay 26, 2024

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. 😄

Copy link
MemberAuthor

@AlexWaygoodAlexWaygoodMay 26, 2024

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.

Copy link
MemberAuthor

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!

@AlexWaygoodAlexWaygood enabled auto-merge (squash) May 26, 2024 12:09
@AlexWaygoodAlexWaygood merged commit 008bc04 into python:mainMay 26, 2024
@AlexWaygoodAlexWaygood deleted the ast-removals branch May 26, 2024 12:34
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
luk1337 added a commit to luk1337/weechat that referenced this pull request Oct 30, 2024
luk1337 added a commit to luk1337/weechat that referenced this pull request Oct 30, 2024
flashcode pushed a commit to weechat/weechat that referenced this pull request Nov 4, 2024
flashcode pushed a commit to weechat/weechat that referenced this pull request Nov 4, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove AST nodes deprecated since Python 3.8, with warnings since Python 3.12

3 participants

@AlexWaygood@hugovk@AraHaan