Hide "object" prefix on dunders in contextlib docs & selectivly link some more#145436
Merged
hugovk merged 2 commits intopython:mainfrom Mar 2, 2026
Merged
Hide "object" prefix on dunders in contextlib docs & selectivly link some more#145436hugovk merged 2 commits intopython:mainfrom
hugovk merged 2 commits intopython:mainfrom
Conversation
nedbat
approved these changes
Mar 2, 2026
Member
|
I wonder if this is something linklint could do for us. |
merwok
approved these changes
Mar 2, 2026
hugovk
approved these changes
Mar 2, 2026
|
Thanks @CAM-Gerlach for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Mar 2, 2026
…some more (pythonGH-145436) (cherry picked from commit 9124bc1) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Mar 2, 2026
…some more (pythonGH-145436) (cherry picked from commit 9124bc1) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
|
GH-145443 is a backport of this pull request to the 3.14 branch. |
|
GH-145444 is a backport of this pull request to the 3.13 branch. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Per the "underline links" discussion on Discourse and my comment there, this PR adds the
~operator to a number ofobject.__dunder__xrefs in the contextlib docs that are missing it, so thatobjectis no longer repeated over and over doubling the length of each link and looking much more repetitive and distracting. The fact that the dunders are documented onobjectis mostly an implementation detail in this context and distracts rather than add clarity here. Furthermore, the fact that they are linked makes it generally less vital to fully qualify names in the text referring to them, since that information is encoded in the link.Additionally, I've also selectively added xref links to a handful of other instances of these dunders elsewhere in this doc, where there wasn't already a linked reference anywhere nearby.
📚 Documentation preview 📚: https://cpython-previews--145436.org.readthedocs.build/