Skip to content

Docs: avoid repetitions of class references in functions.rst#150891

Merged
hugovk merged 2 commits into
python:mainfrom
m-aciek:docs-library-functions-ref-links-fixes
Jun 12, 2026
Merged

Docs: avoid repetitions of class references in functions.rst#150891
hugovk merged 2 commits into
python:mainfrom
m-aciek:docs-library-functions-ref-links-fixes

Conversation

@m-aciek

@m-aciek m-aciek commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

With Linklint we link only first reference in a paragraph. In effect references intended to link aren't links.

Simplify descriptions to avoid repetitions and this issue. In dict, frozendict, frozenset and set reference docs.

Before:

Zrzut ekranu 2026-06-3 o 23 49 34 Zrzut ekranu 2026-06-3 o 23 57 08 Zrzut ekranu 2026-06-3 o 23 57 31 Zrzut ekranu 2026-06-3 o 23 57 58

After:

Screenshot_20260604-153809_Firefox.png Screenshot_20260604-153853_Firefox.png Screenshot_20260604-153913_Firefox.png Screenshot_20260604-153938_Firefox.png

Changelog:

  • first iteration was mechanically changing which references are links
  • second iteration does editorial change to avoid repetitions

With Linklint we link only first reference in a paragraph. Explicitly leave only reference which is expected to link.

In dict, frozendict, frozenset and set reference docs.
@read-the-docs-community

read-the-docs-community Bot commented Jun 3, 2026

Copy link
Copy Markdown

@hugovk hugovk added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jun 4, 2026

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@nedbat Although I wonder if linklint could prefer linking the instances in a "See x [and y]" sentence, or would that be unreliable?

@nedbat

nedbat commented Jun 4, 2026

Copy link
Copy Markdown
Member

As I read these paragraphs, I wonder what value these sentences actually add:

  • "The [dict] object is the dictionary class."
  • "[frozenset] is a built-in class."

About linklint: it's an interesting idea to preserve links in "See ..." sentences. I wonder if it is reliable enough, and if there are other sentence structures to consider. Also, what about translations?

@hugovk

hugovk commented Jun 4, 2026

Copy link
Copy Markdown
Member

As I read these paragraphs, I wonder what value these sentences actually add:

Good point: "See x and y for documentation on x and y" is rather pointless! Let's delete them and just have the previous mentions link as usual.

Something like this?

    Create a new dictionary.  The :class:`dict` object is the dictionary class.
-   See :class:`dict` and :ref:`typesmapping` for documentation about this class.
+   See also :ref:`typesmapping` for documentation about this class.

@m-aciek m-aciek marked this pull request as draft June 4, 2026 12:58
@m-aciek m-aciek changed the title Docs: improve class references linking in functions.rst Docs: avoid repetitions of class references in functions.rst Jun 4, 2026
@m-aciek m-aciek marked this pull request as ready for review June 4, 2026 13:46
@m-aciek m-aciek requested a review from hugovk June 4, 2026 13:46
@m-aciek

m-aciek commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the review! I've simplified all paragraphs.

Also, what about translations?

We would need to maintain also translations' sentence structures to keep this behaviour for localised docs.

In Polish the one-to-one translation would be Zobacz [ref], but often (and in cases here) we don't use direct translation, but phrase it differently for better reading, it would be needed to use znajduje się {…} [ref]. All in all in my opinion there's potential for it to become impractical to maintain, as costly and fragile.

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@hugovk

hugovk commented Jun 12, 2026

Copy link
Copy Markdown
Member

Thanks!

@hugovk hugovk merged commit d986124 into python:main Jun 12, 2026
36 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jun 12, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @m-aciek for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @m-aciek and @hugovk, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker d986124d83465190987357f987ee24bd7a817cac 3.14

@bedevere-app

bedevere-app Bot commented Jun 12, 2026

Copy link
Copy Markdown

GH-151405 is a backport of this pull request to the 3.15 branch.

@miss-islington-app

Copy link
Copy Markdown

Sorry, @m-aciek and @hugovk, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker d986124d83465190987357f987ee24bd7a817cac 3.13

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jun 12, 2026
@bedevere-app

bedevere-app Bot commented Jun 12, 2026

Copy link
Copy Markdown

GH-151406 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 12, 2026
@bedevere-app

bedevere-app Bot commented Jun 12, 2026

Copy link
Copy Markdown

GH-151407 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 12, 2026
hugovk pushed a commit that referenced this pull request Jun 12, 2026
hugovk added a commit that referenced this pull request Jun 12, 2026
hugovk added a commit that referenced this pull request Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants