GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — gh-90953: Emit deprecation warnings for `ast` features deprecated in Python 3.8 by AlexWaygood · Pull Request #104199 · python/cpython Conversation
|
| 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.
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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks very much, both of you! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…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]>
|
@AlexWaygood Is it time to make the PR to remove them now? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
yes |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
See #119563 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.