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>
asottile
left a comment
There was a problem hiding this comment.
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.
shouldn't this be PendingDeprecationWarning
There was a problem hiding this comment.
It is a PendingDeprecationWarning in 3.8 and a DeprecationWarning in 3.9.
There was a problem hiding this comment.
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