Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-90953: Emit deprecation warnings forast 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commentedMay 5, 2023
edited
Loading

This is a continuation of@serhiy-storchaka's PR#31432, but removes the deprecation warnings forast.ExtSlice andast.Index, which were only deprecated in Python 3.9 (rationale for excluding them:#31432 (comment)).


📚 Documentation preview 📚:https://cpython-previews--104199.org.readthedocs.build/

@AlexWaygoodAlexWaygood added type-featureA feature request or enhancement stdlibPython modules in the Lib dir 3.12only security fixes labelsMay 5, 2023
self.assertIsInstance(n, N)
self.assertIsinstance(n, ast.Num)
self.assertNotIsInstance(n, N2)
self.assertNotIsInstance(ast.Num(42), N)
Copy link
Member

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.

AlexWaygood reacted with heart emoji
Copy link
Contributor

@barneygalebarneygale left a 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 theast module? Would it not be sufficient to emit warnings when these classes are instantiated (+isinstance etc)?

@AlexWaygood
Copy link
MemberAuthor

Is it necessary to emit deprecation warnings when the names are accessed on theast module? Would it not be sufficient to emit warnings when these classes are instantiated (+isinstance etc)?

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 callingisinstance() on it, but you do reference it (if type(blah) is ast.Num, etc.). But you are right that we could probably simplify the code somewhat if we only warned on instantiation andisinstance() checks.

@hugovk, do you have any thoughts on this?

barneygale reacted with thumbs up emoji

@hugovk
Copy link
Member

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 aDeprecationWarning first, just mentioning in docs :)

AlexWaygood and barneygale reacted with thumbs up emoji

@AlexWaygoodAlexWaygoodenabled auto-merge (squash)May 6, 2023 16:20
@AlexWaygood
Copy link
MemberAuthor

AlexWaygood commentedMay 6, 2023
edited
Loading

Thanks very much, both of you!

@AlexWaygoodAlexWaygood merged commit376137f intopython:mainMay 6, 2023
@AlexWaygoodAlexWaygood deleted the ast-deprecation-warnings branchMay 6, 2023 16:51
jbower-fb pushed a commit to jbower-fb/cpython that referenced this pull requestMay 8, 2023
…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 <storchaka@gmail.com>
@iritkatriel
Copy link
Member

@AlexWaygood Is it time to make the PR to remove them now?

@AlexWaygood
Copy link
MemberAuthor

@AlexWaygood Is it time to make the PR to remove them now?

yes

@AlexWaygood
Copy link
MemberAuthor

@AlexWaygood Is it time to make the PR to remove them now?

See#119563

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@barneygalebarneygalebarneygale approved these changes

@hugovkhugovkhugovk approved these changes

@serhiy-storchakaserhiy-storchakaAwaiting requested review from serhiy-storchaka

@isidenticalisidenticalAwaiting requested review from isidenticalisidentical is a code owner

Assignees
No one assigned
Labels
3.12only security fixesstdlibPython modules in the Lib dirtype-featureA feature request or enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@AlexWaygood@hugovk@iritkatriel@barneygale@bedevere-bot@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp