You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add deprecation warnings for deprecated items in ast.py #140344
Actually remove the following classes, which were marked as deprecated in Python 3.9:
classSuite(mod):
"""Deprecated AST node class. Unused in Python 3."""classAugLoad(expr_context):
"""Deprecated AST node class. Unused in Python 3."""classAugStore(expr_context):
"""Deprecated AST node class. Unused in Python 3."""
These were previously removed but then restored in GH-19056 (Python 3.9)
If it's not feasible to remove them in 3.15 (for instance, as there was never been a runtime deprecation warning added) then add the runtime deprecation instead.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
I'll close the first PR I made and open a fresh one that adds deprecation notices. Is warnings.deprecated decorator an appropriate way to do that? I'll have a gander at how this is being done elsewhere.
Activity
ast: Remove classes deprecated in 3.9 (python#140344)
pythongh-140344: ast: Remove classes deprecated in 3.9
[-]Actually reomve deprecated classes from ast.py[/-][+]Actually remove deprecated classes from ast.py[/+]pythongh-140344: ast: Remove classes deprecated in 3.9
hugovk commentedon Oct 20, 2025
We should follow PEP 387 and add deprecation warnings for a few releases first.
#19056 (comment) says why we didn't do that before, but let's do that now.
jepler commentedon Oct 20, 2025
Thanks for the feedback.
I'll close the first PR I made and open a fresh one that adds deprecation notices. Is
warnings.deprecateddecorator an appropriate way to do that? I'll have a gander at how this is being done elsewhere.hugovk commentedon Oct 20, 2025
I usually use
warnings._deprecated: https://discuss.python.org/t/introducing-warnings-deprecated/14856For example:
cpython/Lib/imaplib.py
Lines 1969 to 1971 in e4f6445
hugovk commentedon Oct 20, 2025
If you want, we can re-use this issue and just change the title/description?
pythongh-140344: ast: Add deprecation warnings
jepler commentedon Oct 20, 2025
Oops, my mistake -- I closed the issue instead of the PR. If you re-open this, that would be excellent.
[-]Actually remove deprecated classes from ast.py[/-][+]Add deprecation warnings for deprecated items in ast.py[/+]Merge remote-tracking branch 'upstream/main' into pr-140345-jepler-py…
Merge remote-tracking branch 'origin/main' into pythongh-140344
pythongh-140344: Re-target deprecation to occur in 3.21
gh-140344: ast: Add deprecation warnings (#140345)
hugovk commentedon May 18, 2026
Thank you for the PR! 🎉