-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-101100: fix sphinx warnings in reference/datamodel.rst #114280
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
Conversation
@@ -885,7 +885,7 @@ Predefined (writable) attributes: | |||
:attr:`__name__` | |||
The module's name. | |||
|
|||
:attr:`__doc__` | |||
:attr:`~definition.__doc__` |
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'd prefer to fix these warnings by creating a single canonical table in the datamodel docs, and removing duplicated documentation elsewhere: see #101100 (comment) (and see PRs where I did similar things for other lists like this in this document: #112781, #112735, #112832, #112933)
@@ -5492,6 +5492,17 @@ types, where they are relevant. Some of these are not reported by the | |||
The tuple of base classes of a class object. | |||
|
|||
|
|||
.. attribute:: definition.__module__ |
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.
In my opinion, the attributes listed here should only be attributes such as __dict__
and __class__
that appear on all Python objects (I'm aware that's not currently the case, but that's a problem, in my opinion).
We already have a dedicated reference for the __module__
attribute on function objects; I think we should do the same for the __module__
attribute on class objects: https://docs.python.org/3/reference/datamodel.html#function.__module__ (ditto for __doc__
)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Suggestion: you may want to consider separate PRs for tackling warnings relating to module attributes and those relating to class attributes. Fixing the Sphinx nitpicks in the datamodel docs in a principled way is not trivial -- I've been picking away at them for a while, in #112737, #112781, #112735, #112832, #112933, etc. :) Keeping the PRs small will make it easier for us to review your PRs, and make it easier for you to address our feedback. I haven't as much time to work on it right now, so it's great some other people are getting involved! |
Directive |
#114336 - is a set/frozenset issue. |
📚 Documentation preview 📚: https://cpython-previews--114280.org.readthedocs.build/