GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add a guide to deprecating features by Lincoln-developer · Pull Request #1469 · python/devguide

Conversation

@Lincoln-developer

@Lincoln-developer Lincoln-developer commented Nov 8, 2024 •
edited by hugovk
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This pull request introduces a new section in the Developer Guide to document the practical steps for deprecating features in CPython. It complements the policy guidelines outlined in PEP 387 by providing a detailed, actionable workflow for contributors


📚 Documentation preview 📚: https://cpython-devguide--1469.org.readthedocs.build/developer-workflow/cpython-deprecation-workflow/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Lincoln-developer added 2 commits November 8, 2024 15:24
@Lincoln-developer
Added deprecation workflow in CPython.
f2fd360
@Lincoln-developer
Fixed sphinx-linting error
e99387d
AA-Turner
AA-Turner requested changes Nov 8, 2024
View reviewed changes

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

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.

I think we can make a few improvements here specific to CPython.

A

P.S. Out of idle curiosity, did you use an LLM/GPT to help write this document? There's a couple of hallmarks I recognise, but it could just be a general style!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst Outdated
Comment on lines +25 to +39
* **Raise a Warning**: Use :func:`warnings.warn` with :exc:`DeprecationWarning` for typical cases.
If the feature is in its early deprecation phase:

* Use :exc:`PendingDeprecationWarning` initially, which transitions to :exc:`DeprecationWarning` after a suitable period.

Example:

.. code-block:: python

import warnings
warnings.warn(
"Feature X is deprecated and will be removed in Python 3.Y",
DeprecationWarning,
stacklevel=2
)

@AA-Turner AA-Turner Nov 8, 2024

Copy link
Copy Markdown
Member

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.

We should probably use warnings._deprecated() instead here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Lincoln-developer Lincoln-developer Nov 8, 2024

Copy link
Copy Markdown
Contributor Author

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.

Thanks let me work on this change

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread developer-workflow/cpython-deprecation-workflow.rst Outdated
------------------------------------
Before proposing deprecation:

* **Assess Usage**: Use tools like GitHub search, ``grep``, or ``PyPI statistics`` to determine the extent and context of usage.

@AA-Turner AA-Turner Nov 8, 2024

Copy link
Copy Markdown
Member

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.

Perhaps you could add links here?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@Lincoln-developer Lincoln-developer Nov 8, 2024

Copy link
Copy Markdown
Contributor Author

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.

okay sure, let me add them

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread developer-workflow/cpython-deprecation-workflow.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner changed the title gh-1419: Added deprecation workflow for CPython. Add a guide to deprecating features Nov 8, 2024
@AA-Turner AA-Turner linked an issue Nov 8, 2024 that may be closed by this pull request
Document the workflow for deprecating something in CPython. #1419
Open
Lincoln-developer and others added 8 commits November 8, 2024 16:07
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
be9224b
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
b8fbd0b
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
207294f
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
a90e99a
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
fc0b4ec
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
7029868
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer @AA-Turner
Update developer-workflow/cpython-deprecation-workflow.rst
0dc75ec
Co-authored-by: Adam Turner <[email protected]>
@Lincoln-developer
fixed requested changes
0d8bd61
@Lincoln-developer
Lincoln-developer requested a review from AA-Turner November 8, 2024 13:38
@Lincoln-developer
fixed required warning function
d077a58
@python-cla-bot

python-cla-bot Bot commented Apr 18, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Sep 8, 2025
View reviewed changes
Comment thread developer-workflow/cpython-deprecation-workflow.rst

Once approved:

* **Raise a Warning**: Use ``warnings._deprecated`` with :exc:`DeprecationWarning` for typical cases.

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

Why is this preferred over the documented and more common warnings.warn (over 3x in the stdlib)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
Comment on lines +1 to +2
Workflow for Deprecating Features in CPython
==============================================

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

Suggested change
Workflow for Deprecating Features in CPython
==============================================
Workflow for Deprecating Features in CPython
============================================

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
Workflow for Deprecating Features in CPython
==============================================

Deprecation in CPython is a multi-step process that involves notifying users about deprecated functionality, planning its eventual removal, and providing adequate guidance for migration.

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

Please wrap lines to 79 characters.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst

Before proposing deprecation:

* **Assess Usage**: Use tools like GitHub search, `grep`_, or `PyPI statistics`_ to determine the extent and context of usage.

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

Maybe add a link to the GitHub search and list Victor's script: https://hugovk.dev/blog/2022/how-to-search-5000-python-projects/ ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
Open an issue
-------------

Start by creating a GitHub issue to propose the deprecation:

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

I think we should recommend a thread on Discourse first?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
------------------

* **Monitor Usage**: After the release, observe community feedback. Deprecations may remain longer than the minimum period if low maintenance overhead is expected or usage is widespread.
* **Timeline Review**: Use GitHub milestones or specific deprecation tracking issues to manage timelines.

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

GitHub milestones

These are not used in CPython?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
* Update documentation, removing references to the deprecated feature.
* Include the removal in the "What's New" for the release.

``PendingDeprecationWarning`` workflow

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

This stage seems odd, how often is this done?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
------------------------

* Use the ``.. deprecated-removed::`` roles for documentation.
* Add ``See Also`` links to :pep:`387` and DevGuide for policy and process details.

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

I don't understand, do you suggest a .. see-also:: under every deprecated feature?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/cpython-deprecation-workflow.rst
* No ``pending-removal-in`` entry is needed during this stage.

References and templates
------------------------

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

We can also link to PEP 4

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread developer-workflow/index.rst
:maxdepth: 5

communication-channels
cpython-deprecation-workflow

@StanFromIreland StanFromIreland Sep 8, 2025

Copy link
Copy Markdown
Member

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.

This should definitely be below development cycle

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@StanFromIreland
StanFromIreland marked this pull request as draft September 8, 2025 21:00
@sirosen

sirosen commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

I see that at least three people have put in effort here, but it's stalled. I can carry it forward, if that seems appropriate.

@StanFromIreland , as the most recent reviewer, what would you think of me picking this up and continuing the work in a new PR?
(I'd preserve these commits, but open a fresh PR with my additions.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Jun 21, 2026

Copy link
Copy Markdown
Member

@sirosen yes, it would be great for someone to pick this up, this has been stale for a while. I would suggest that whoever does pick it up do at least one deprecation in CPython beforehand. I think part of the issue here was that current practices aren't written down, which made it easy to end up inventing new ones. If you have any questions while working on this, feel free to ask/ping me.

Other things worth covering here would be soft deprecations. I also wouldn't focus too much on the "When to deprecate?" section, that's a difficult topic and all cases can't be covered by the docs, some general guidelines would suffice. In the future we could also expand the section to cover removing the deprecated items, as this gets difficult e.g. when things are in the stable ABI.

hugovk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Jun 21, 2026

Copy link
Copy Markdown
Member

And might be worth starting this guide from scratch, rather than continuing from this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sirosen

sirosen commented Jun 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I would suggest that whoever does pick it up do at least one deprecation in CPython beforehand. I think part of the issue here was that current practices aren't written down, which made it easy to end up inventing new ones. If you have any questions while working on this, feel free to ask/ping me.

Unfortunately, that would rule me out as a candidate to carry this work forward. Maybe that's okay, but I am also happy to write down current practice with a bit of guidance. I'll circle back on the idea -- there might be other places where I can be more helpful.


Given that review time was sunk into this, rather than it being closed, I was under the impression that it was close (or close enough) to be worth carrying on and preserving commits/credit.
However, I now see the CLA Signing check is also blocked, so we can't take this work anyway. I recommend closing this.

StanFromIreland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland closed this Jun 25, 2026
@StanFromIreland

StanFromIreland commented Jun 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

CLA Signing check

Based on the bot's comment above, it's alright. But this has been stale for a long time, so I think it's time to close anyway.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sirosen

sirosen commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Oh, I hadn't noticed the comment, only the GHA check status. Odd that they got out of alignment, but okay anyway. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Jun 25, 2026

Copy link
Copy Markdown
Member

It sometimes get stuck like that, if I re-opened it would re-run and go green.

sirosen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@StanFromIreland StanFromIreland StanFromIreland left review comments
@AA-Turner AA-Turner Awaiting requested review from AA-Turner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Document the workflow for deprecating something in CPython.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@Lincoln-developer @sirosen @StanFromIreland @hugovk @AA-Turner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.