gh-141004: Document soft-deprecated symbols#141634
gh-141004: Document soft-deprecated symbols#141634ZeroIntensity merged 19 commits intopython:mainfrom
Conversation
Yes. My opinion is that documentation for deprecated API should tell you what to do if you find it in some dusty legacy codebase. |
Ok, I can do that. I have a few ideas on how we could format this -- which do you prefer?
|
|
I'm not sure that a "Soft-deprecated" section is needed.
That sounds like a reasonable approach. |
I'd prefer “Deprecated API” sections at the end of pages. Alas, that might not be a popular preference :(
That makes sense for “close friends” -- e.g. if the porting instructions tell you to use a specific other function instead. |
If others are fine with a Deprecated API section, I would also be fine with it. |
|
See https://docs.python.org/3/c-api/unicode.html#deprecated-api for an example. I think it's working pretty well. |
It looks nice. |
|
Updated, let me know what you think.
In practice, we don't have great replacements for all of these, so I just documented some of them as "do not use". For example, what is a user supposed to do if they find |
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
Looks good! Hopefully the WG vote will be just a formality. |
|
There are a couple of APIs on the deprecation list that aren't documented here. I'll address those separately. |
|
Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @ZeroIntensity, I could not cleanly backport this to |
|
GH-143837 is a backport of this pull request to the 3.14 branch. |
…GH-143837) gh-141004: Document several soft-deprecated C APIs (GH-141634) (cherry picked from commit 0e0d51c) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
|
We generally don't deprecate API in released versions, so this shouldn't be backported. That said, I wouldn't revert the 3.14 backport that's already merged. With soft deprecations, there's not much harm done. |
These are all APIs that expose implementation details. Instead of truly documenting them and what they do, this PR just adds a note saying "don't use this" with no additional information. This is a good compromise for us; if someone saw these in their IDE, Python will still provide some form of documentation for them, but they won't lead to any additional maintenance burden.
cc @vstinner @encukou -- I suspect both of you will have some strong opinions here.
📚 Documentation preview 📚: https://cpython-previews--141634.org.readthedocs.build