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.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants