Skip to content

Conversation

@AA-Turner
Copy link
Member

@AA-TurnerAA-Turner commented Sep 3, 2025

@AA-TurnerAA-Turner added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Sep 3, 2025
@bedevere-appbedevere-appbot added awaiting core review docs Documentation in the Doc dir skip news labels Sep 3, 2025
@AA-TurnerAA-Turner changed the title Resolve reference warnings in library/stdtypes.rstGH-101100: Resolve reference warnings in library/stdtypes.rstSep 3, 2025
@serhiy-storchaka
Copy link
Member

I think that the right fix for this is to add anchors instead of removing references.

@AA-Turner
Copy link
MemberAuthor

@serhiy-storchaka I've generally been hesitant to suppress cross-references, but I think all the instances here make sense, given their context. Are there some specific ones you would revert?

A

another set. The :class:`frozenset` type is immutable and :term:`hashable` ---
its contents cannot be altered after it is created; it can therefore be used as
a dictionary key or as an element of another set.
like :meth:`add <frozenset.add>` and :meth:`remove <frozenset.add>`.

Choose a reason for hiding this comment

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

There is no frozenset.add().

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Because set and frozenset are documented together, there is no cross-reference target for set.add, it is labelled as frozenset.add instead. This link goes to the correct place.

Choose a reason for hiding this comment

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

But this is a wrong name for anchor. We should do something with this.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I agree. I plan to fix it, but it requires changes (& a release) of Sphinx. This PR makes the reference link to the right place, and more importantly means that no future reference errors can be introduced into stdtypes.rst.

Once it is fixed, I plan to go back and update here & a few other places where we have used a different target to the intended one.

Choose a reason for hiding this comment

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

Now, I think that we should reorganize the set/frozenset documentation in the way similar to the sequence or bytes/bytearray documentation.

  1. Dedent method descriptions and add class name prefixes. E.g.:
    .. method:: frozenset.isdisjoint(other, /) set.isdisjoint(other, /)
  2. Move operators to separate tables. This may wait.

Choose a reason for hiding this comment

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

#141857 implements this approach.

@serhiy-storchaka
Copy link
Member

Are there some specific ones you would revert?

All of them? See my suggestion #101100 (comment) . After implementing it the references in footnotes will gone, as they will become the part of the method description, and many other references will became working. After that we can check what remains.

@AA-Turner
Copy link
MemberAuthor

See #138474, putting this in draft for now.

A

@AA-TurnerAA-Turner marked this pull request as draft September 3, 2025 21:00
# Conflicts: # Doc/library/stdtypes.rst
@AA-TurnerAA-Turner marked this pull request as ready for review September 5, 2025 20:58
@hugovk
Copy link
Member

(Resolved conflict)

@AA-TurnerAA-Turner merged commit cde19e5 into python:mainNov 22, 2025
28 checks passed
@github-project-automationgithub-project-automationbot moved this from Todo to Done in Docs PRsNov 22, 2025
@miss-islington-app
Copy link

Thanks @AA-Turner for the PR 🌮🎉.. 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 Nov 22, 2025
…ythonGH-138420) (cherry picked from commit cde19e5) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @AA-Turner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker cde19e565cc9127fe5db38358ebf3bbd75a9d2cd 3.13 

@bedevere-appbedevere-appbot removed the needs backport to 3.14 bugs and security fixes label Nov 22, 2025
hugovk pushed a commit that referenced this pull request Nov 22, 2025
…H-138420) (#141855) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
another set. The :class:`frozenset` type is immutable and :term:`hashable` ---
its contents cannot be altered after it is created; it can therefore be used as
a dictionary key or as an element of another set.
like :meth:`add <frozenset.add>` and :meth:`remove <frozenset.add>`.

Choose a reason for hiding this comment

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

Wrong reverence to remove().

StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…s.rst (pythonGH-138420) (cherry picked from commit cde19e5) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@StanFromIreland
Copy link
Member

We actually don't need to backport this, it is superseded by the backport of 1d8f3ed, #142345.

@StanFromIrelandStanFromIreland removed the needs backport to 3.13 bugs and security fixes label Dec 6, 2025
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

@AA-Turner@serhiy-storchaka@hugovk@StanFromIreland@aisk