Skip to content
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

gh-101100: Fix most Sphinx nitpicks in inspect.rst #112662

Merged
merged 3 commits into from
Dec 3, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Dec 3, 2023

  • Fix links to the data-model entries for __getattribute__(), __getattr__() and __dir__()
  • Tell Sphinx not to try to create links for the __doc__ attribute. type.__doc__, function.__doc__ and module.__doc__ are all documented in separate places; it's not clear which would be best to link to here.
  • Across the whole documentation, tell Sphinx not to try to create links to inspect.getargspec. It's deprecated, and it was never documented.
  • Where the __func__ attribute is referenced, add links to the data-model docs on instance methods. The attribute is explained well there.

There's one nitpick warning remaining in inspect.rst after this PR:

cpython\Doc\library\inspect.rst:1167: WARNING: py:attr reference target not found: __wrapped__

We don't seem to have a good canonical description anywhere for the __wrapped__ attribute; we should add one. I'm deferring that task for now, since it requires a bit more effort than any of the other things I'm doing as part of this PR :)


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

@hugovk
Copy link
Member

hugovk commented Dec 3, 2023

  • Across the whole documentation, tell Sphinx not to try to create links to inspect.getargspec. It's deprecated, and it was never documented.

What do you think about putting this in nitpick_ignore in Doc.conf.py? Then it's only one line added instead of several changed (and some files not needing any change), plus future uses won't need the same ! treatment?

@AlexWaygood
Copy link
Member Author

  • Across the whole documentation, tell Sphinx not to try to create links to inspect.getargspec. It's deprecated, and it was never documented.

What do you think about putting this in nitpick_ignore in Doc.conf.py? Then it's only one line added instead of several changed (and some files not needing any change), plus future uses won't need the same ! treatment?

That makes sense to me; I'll make the change!

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

👍

@AlexWaygood AlexWaygood enabled auto-merge (squash) December 3, 2023 17:25
@AlexWaygood AlexWaygood enabled auto-merge (squash) December 3, 2023 17:27
@AlexWaygood AlexWaygood merged commit 45650d1 into python:main Dec 3, 2023
23 checks passed
@AlexWaygood AlexWaygood deleted the sphinx-inspect-nitpicks branch December 3, 2023 17:32
@miss-islington-app
Copy link

Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2023
…112662)

(cherry picked from commit 45650d1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Dec 3, 2023

GH-112666 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Dec 3, 2023
@bedevere-app
Copy link

bedevere-app bot commented Dec 3, 2023

GH-112667 is a backport of this pull request to the 3.11 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2023
…112662)

(cherry picked from commit 45650d1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Dec 3, 2023
AlexWaygood added a commit that referenced this pull request Dec 3, 2023
… (#112667)

gh-101100: Fix most Sphinx nitpicks in `inspect.rst` (GH-112662)
(cherry picked from commit 45650d1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood added a commit that referenced this pull request Dec 3, 2023
… (#112666)

gh-101100: Fix most Sphinx nitpicks in `inspect.rst` (GH-112662)
(cherry picked from commit 45650d1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
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 skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants