Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-90953: Emit deprecation warnings for ast features deprecated in Python 3.8#104199
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
AlexWaygood commented May 5, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Misc/NEWS.d/next/Library/2022-02-19-14-19-34.bpo-46797.6BXZX4.rst Outdated Show resolvedHide resolved
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Hugo van Kemenade <[email protected]>
…good/cpython into ast-deprecation-warnings
| self.assertIsInstance(n, N) | ||
| self.assertIsinstance(n, ast.Num) | ||
| self.assertNotIsInstance(n, N2) | ||
| self.assertNotIsInstance(ast.Num(42), N) |
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.
Nice :)
By the way, https://github.com/isidentical/teyit / https://pypi.org/project/teyit/ is a nice tool that can upgrade some of these automatically.
barneygale left a comment
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.
Is it necessary to emit deprecation warnings when the names are accessed on the ast module? Would it not be sufficient to emit warnings when these classes are instantiated (+ isinstance etc)?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
AlexWaygood commented May 6, 2023
I guess I lean towards keeping them just to ensure maximum visibility. There are edge cases where you might not be "using" the class or calling @hugovk, do you have any thoughts on this? |
hugovk commented May 6, 2023
If there are two common ways of accessing something, I'd also lean towards more visibility for both. Speaking from a position of having dealt with the fallout of removing something without a |
AlexWaygood commented May 6, 2023 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Thanks very much, both of you! |
…ed in Python 3.8 (python#104199) `ast.Num`, `ast.Str`, `ast.Bytes`, `ast.Ellipsis` and `ast.NameConstant` now all emit deprecation warnings on import, access, instantation or `isinstance()` checks. Co-authored-by: Serhiy Storchaka <[email protected]>
iritkatriel commented May 24, 2024
@AlexWaygood Is it time to make the PR to remove them now? |
AlexWaygood commented May 25, 2024
yes |
AlexWaygood commented May 25, 2024
See #119563 |
This is a continuation of @serhiy-storchaka's PR #31432, but removes the deprecation warnings for
ast.ExtSliceandast.Index, which were only deprecated in Python 3.9 (rationale for excluding them: #31432 (comment)).📚 Documentation preview 📚: https://cpython-previews--104199.org.readthedocs.build/