Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-101100: Fix sphinx warnings inDoc/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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

LamentXU123
Copy link
Contributor

@LamentXU123LamentXU123 commentedJul 8, 2025
edited
Loading

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 tocache_info andcache_clear are subpressed. Same to the formar subpressed linkcache_parameters Create an index entries and anchor ofcache_info andcache_clear
  • __lt__,__le__,__gt__,__ge__,__eq__ are magic methods ofobject. So It's changed to~object.__lt__, etc.
  • abstractmethod is actually referring toabc.abstractmethod. So it's changed to~abc.abstractmethod
  • register is actually a function ofgeneric function.Since we don't get a doc about it., the link is supressed. Create an index entries and anchor ofregister
  • 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-storchakaserhiy-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 forcache_info,cache_clear andregister. You can use:no-typesetting: for this. For example:

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

Check if this generates a nice index entry.

LamentXU123 reacted with heart emoji
@rhettingerrhettinger removed their request for reviewJuly 8, 2025 20:08
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment
edited
Loading

Choose a reason for hiding this comment

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

Thank you for your response.

Please move the definitions immediately above the paragraph that defines the corresponding method. The references can be made inert, e.g.:meth:`!clear_cache`, because it doesn't make sense to add a link to the same paragraph now.

Also, I think that it is better to add a prefix, e.g... method:: functools.cache_info(). So the index will contain "cache_info() (functools.lru_cache method)" instead of "cache_info() (in module functools)".

We need to add also an index entry forproperty.setter, etc, but this is a different issue.

LamentXU123 reacted with eyes emoji
@LamentXU123
Copy link
ContributorAuthor

LamentXU123 commentedJul 10, 2025
edited
Loading

Thank you very much for teaching me this!

I update the prefix and move the definitions to the paragraph that defines the corresponding method, also subpress the referrences.

We need to add also an index entry for property.setter

+1, I think we can add index in later issues.

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Please move also.. method:: register() and add a prefix to it.

LamentXU123and others added2 commitsJuly 11, 2025 20:38
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@LamentXU123
Copy link
ContributorAuthor

Please move also.. method:: register() and add a prefix to it.

Thanks, I will fix it soon.

LamentXU123and others added2 commitsJuly 11, 2025 21:12
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@LamentXU123
Copy link
ContributorAuthor

Done, Thanks!

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. 👍

Thank you for your contribution@LamentXU123.

@serhiy-storchakaserhiy-storchaka added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJul 11, 2025
@serhiy-storchakaserhiy-storchaka merged commit252e2f7 intopython:mainJul 11, 2025
25 checks passed
@github-project-automationgithub-project-automationbot moved this fromTodo toDone inDocs PRsJul 11, 2025
@miss-islington-app
Copy link

Thanks@LamentXU123 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. 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 requestJul 11, 2025
…thonGH-136424)Add index entries and anchors for cache_info, cache_clear and register.(cherry picked from commit252e2f7)Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry,@LamentXU123 and@serhiy-storchaka, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 252e2f710ea376a38c4545dd758e03d331c1eaad 3.13

@bedevere-app
Copy link

GH-136552 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelJul 11, 2025
serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull requestJul 11, 2025
…rst (pythonGH-136424)Add index entries and anchors for cache_info, cache_clear and register.(cherry picked from commit252e2f7)Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
@bedevere-app
Copy link

GH-136554 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJul 11, 2025
serhiy-storchaka pushed a commit that referenced this pull requestJul 11, 2025
…H-136424) (GH-136552)Add index entries and anchors for cache_info, cache_clear and register.(cherry picked from commit252e2f7)Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
serhiy-storchaka added a commit that referenced this pull requestJul 11, 2025
…H-136424) (GH-136554)Add index entries and anchors for cache_info, cache_clear and register.(cherry picked from commit252e2f7)Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull requestJul 12, 2025
…thonGH-136424)Add index entries and anchors for cache_info, cache_clear and register.
picnixz pushed a commit to picnixz/cpython that referenced this pull requestJul 13, 2025
…thonGH-136424)Add index entries and anchors for cache_info, cache_clear and register.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AA-TurnerAA-TurnerAA-Turner left review comments

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

@hugovkhugovkAwaiting requested review from hugovkhugovk is a code owner

Labels
docsDocumentation in the Doc dirskip news
Projects
Status: Done
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@LamentXU123@serhiy-storchaka@AA-Turner

[8]ページ先頭

©2009-2025 Movatter.jp