Skip to content

Conversation

@AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Sep 3, 2025

@AA-Turner AA-Turner requested a review from hugovk as a code owner September 3, 2025 00:26
@AA-Turner AA-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-app bedevere-app bot added awaiting core review docs Documentation in the Doc dir skip news labels Sep 3, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Sep 3, 2025
@AA-Turner AA-Turner changed the title Resolve reference warnings in library/stdtypes.rst GH-101100: Resolve reference warnings in library/stdtypes.rst Sep 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
Member Author

@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>`.
Copy link
Member

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
Member Author

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.

Copy link
Member

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
Member Author

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.

Copy link
Member

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.

Copy link
Member

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
Member Author

See #138474, putting this in draft for now.

A

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

hugovk commented Nov 22, 2025

(Resolved conflict)

@AA-Turner AA-Turner merged commit cde19e5 into python:main Nov 22, 2025
28 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Nov 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
@bedevere-app
Copy link

bedevere-app bot commented Nov 22, 2025

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-app bedevere-app bot 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
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>`.
Copy link
Member

Choose a reason for hiding this comment

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

Wrong reverence to remove().

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 needs backport to 3.13 bugs and security fixes skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants