Skip to content

gh-140344: ast: Add deprecation warnings#140345

Merged
JelleZijlstra merged 13 commits into
python:mainfrom
jepler:gh-140344
May 18, 2026
Merged

gh-140344: ast: Add deprecation warnings#140345
JelleZijlstra merged 13 commits into
python:mainfrom
jepler:gh-140344

Conversation

@jepler
Copy link
Copy Markdown
Contributor

@jepler jepler commented Oct 20, 2025

Copy link
Copy Markdown
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see Hugo's comment on the issue, these need to raise deprecation warnings till 3.17 minimum (I don't think we need to do five years here, two should be fine).

These were all deprecated in 3.9 (bace59d) but without
a runtime deprecation warning. Add it now, so that these
items can be removed in 3.20 per PEP 387.
@jepler jepler changed the title gh-140344: ast: Remove classes deprecated since 3.9 gh-140344: ast: Add deprecation warnings Oct 20, 2025
@jepler
Copy link
Copy Markdown
Contributor Author

jepler commented Oct 20, 2025

I've updated this PR so that it makes deprecation warnings. Currently the deprecation says 3.20 is the time for removal (standard PEP 387) but I can change it to 3.17 if there's consensus that it's OK to do so.

Comment thread Misc/NEWS.d/next/Library/2025-10-20-09-12-18.gh-issue-140344.WjbYg-.rst Outdated
Comment thread Lib/ast.py
Comment thread Misc/NEWS.d/next/Library/2025-10-20-09-12-18.gh-issue-140344.WjbYg-.rst Outdated
@hugovk
Copy link
Copy Markdown
Member

hugovk commented Oct 21, 2025

Please list these in "What's new in Python 3.15" > "New deprecations" and "Pending removal in Python 3.20":

@jepler jepler requested a review from AA-Turner as a code owner October 21, 2025 15:01
@jepler
Copy link
Copy Markdown
Contributor Author

jepler commented Oct 21, 2025

Please list these in "What's new in Python 3.15" > "New deprecations" and "Pending removal in Python 3.20":

done!

Comment thread Doc/deprecations/pending-removal-in-3.20.rst Outdated
Comment thread Lib/ast.py
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label May 1, 2026
@hugovk
Copy link
Copy Markdown
Member

hugovk commented May 2, 2026

@jepler Please make the requested changes if you would like this merged for 3.15. The feature freeze is on Tuesday, things merged after that will have to target 3.16 (October 2027).

…thongh-140344

# Conflicts:
#	Doc/deprecations/pending-removal-in-3.20.rst
#	Doc/whatsnew/3.15.rst
#	Lib/test/test_ast/test_ast.py
@JelleZijlstra
Copy link
Copy Markdown
Member

I think this should be good now, @hugovk @StanFromIreland what do you think?

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 2, 2026

@JelleZijlstra
Copy link
Copy Markdown
Member

(Hold on, there's some more things to fix.)

@jepler
Copy link
Copy Markdown
Contributor Author

jepler commented May 4, 2026

@JelleZijlstra thank you for stepping up. I dropped the ball on this very badly.

@github-actions github-actions Bot removed the stale Stale PR or inactive for long period of time. label May 16, 2026
@JelleZijlstra
Copy link
Copy Markdown
Member

@StanFromIreland can you take another look? (You previously requested changes.)

@StanFromIreland StanFromIreland dismissed their stale review May 18, 2026 17:21

Addressed

@StanFromIreland
Copy link
Copy Markdown
Member

I dismissed it.

@JelleZijlstra JelleZijlstra merged commit 806c997 into python:main May 18, 2026
77 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants