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
bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). #15490
bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). #15490
Conversation
…nt(). It emits a deprecation message and calls corresponding method visit_Num(), visit_Str(), etc.
Co-Authored-By: Xtreak <tir.karthi@gmail.com>
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.
thanks!
(not sure I agree with deprecating these in the same release, but at least this fixes the code it broke)
There are no much problems with the deprecation in the same release because |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…nt(). (pythonGH-15490) It emits a deprecation warning and calls corresponding method visit_Num(), visit_Str(), etc. (cherry picked from commit c3ea41e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-15509 is a backport of this pull request to the 3.8 branch. |
else: | ||
import warnings | ||
warnings.warn(f"{method} is deprecated; add visit_Constant", | ||
DeprecationWarning, 2) |
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.
shouldn't this be PendingDeprecationWarning
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.
It is a PendingDeprecationWarning in 3.8 and a DeprecationWarning in 3.9.
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.
Ah right, this is to 3.9! Silly me
…nt(). (pythonGH-15490) It emits a deprecation warning and calls corresponding method visit_Num(), visit_Str(), etc.
…nt(). (pythonGH-15490) It emits a deprecation warning and calls corresponding method visit_Num(), visit_Str(), etc.
…nt(). (pythonGH-15490) It emits a deprecation warning and calls corresponding method visit_Num(), visit_Str(), etc.
It emits a deprecation message and calls corresponding method
visit_Num(), visit_Str(), etc.
https://bugs.python.org/issue36917