-
-
Notifications
You must be signed in to change notification settings - Fork 33k
GH-101100: Resolve reference warnings in library/stdtypes.rst #138420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I think that the right fix for this is to add anchors instead of removing references. |
@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>`. |
There was a problem hiding this comment.
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()
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
- Dedent method descriptions and add class name prefixes. E.g.:
.. method:: frozenset.isdisjoint(other, /) set.isdisjoint(other, /)
- Move operators to separate tables. This may wait.
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. |
See #138474, putting this in draft for now. A |
# Conflicts: # Doc/library/stdtypes.rst
📚 Documentation preview 📚: https://cpython-previews--138420.org.readthedocs.build/