Skip to content

gh-101100: Fix sphinx warnings in Doc/library/functools.rst #136424

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

LamentXU123
Copy link
Contributor

@LamentXU123 LamentXU123 commented Jul 8, 2025

before:

C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:202: WARNING: py:func reference target not found: cache_info [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:207: WARNING: py:func reference target not found: cache_clear [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:287: WARNING: py:meth reference target not found: __lt__ [ref.meth]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:287: WARNING: py:meth reference target not found: __le__ [ref.meth]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:287: WARNING: py:meth reference target not found: __gt__ [ref.meth]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:287: WARNING: py:meth reference target not found: __ge__ [ref.meth]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:287: WARNING: py:meth reference target not found: __eq__ [ref.meth]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:420: WARNING: py:func reference target not found: abstractmethod [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:502: WARNING: py:func reference target not found: register [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:567: WARNING: py:func reference target not found: register [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:575: WARNING: py:func reference target not found: register [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:653: WARNING: py:func reference target not found: register [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:656: WARNING: py:func reference target not found: register [ref.func]
C:\Users\admin\Downloads\cpython-main\Doc\library\functools.rst:785: WARNING: py:func reference target not found: example [ref.func]

This PR fix them all, I will explain all my changes:

  • link to cache_info and cache_clear are subpressed. Same to the formar subpressed link cache_parameters Create an index entries and anchor of cache_info and cache_clear
  • __lt__ , __le__, __gt__, __ge__, __eq__ are magic methods of object. So It's changed to ~object.__lt__, etc.
  • abstractmethod is actually referring to abc.abstractmethod. So it's changed to ~abc.abstractmethod
  • register is actually a function of generic function. Since we don't get a doc about it., the link is supressed. Create an index entries and anchor of register
  • example is an example function. The link is supressed.

Thanks!

The doc preview of this PR on this library: https://cpython-previews--136424.org.readthedocs.build/en/136424/library/functools.html


📚 Documentation preview 📚: https://cpython-previews--136424.org.readthedocs.build/

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

It would be nice to add index entries and anchors for cache_info, cache_clear and register. You can use :no-typesetting: for this. For example:

.. method:: cache_info()
   :no-typesetting:

Check if this generates a nice index entry.

@rhettinger rhettinger removed their request for review July 8, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants