Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-101100: Consolidate documentation onModuleType
attributes#124709
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
AlexWaygood commentedSep 27, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Docs preview for the new sections in the datamodel describing module attributes:https://cpython-previews--124709.org.readthedocs.build/en/124709/reference/datamodel.html#modules |
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.
Thank you!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Doc/reference/datamodel.rst Outdated
.. versionchanged:: 3.12 | ||
The value of :attr:`!module__loader__` is expected to be the same as | ||
:attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>`. | ||
The use of :attr:`!module.__loader__` is deprecated and slated for | ||
removal in Python 3.14. |
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.
Should this use adeprecated-removed
?
Is it documented in What's New anddeprecations/pending-removal-in-3.14.rst
?
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.
Should this use a
deprecated-removed
?
I think that makes sense!
Is it documented in What's New and
deprecations/pending-removal-in-3.14.rst
?
It doesn't appear so. This note is mostly copied from the note that currently exists athttps://docs.python.org/3/reference/import.html#loader__, but with some more cross-reference links added.
I'll change the directive to be.. deprecated-removed
, but I'mkinda tempted to say that adding a note to "What's new" is out of scope for this PR, which essentially moves documentation around and consolidates it rather than adding new documentation.
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Barry Warsaw <barry@python.org>
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Barry Warsaw <barry@python.org>
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'm not quite finished reviewing this, but because my laptop got rebooted, I'm hoping GH preserved my previous comments. I'll complete the review hopefully tomorrow.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
When you're done making the requested changes, leave the comment: |
AlexWaygood commentedOct 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks all for the excellent review comments! I'm going to land this now -- there's definitely still room for improvement, but I think it can all be done in followups. A summary of things that could still be clarified:
|
3024b16
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Thanks@AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks@AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Thanks@AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry,@AlexWaygood, I could not cleanly backport this to
|
Sorry,@AlexWaygood, I could not cleanly backport this to
|
…tributes (python#124709)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>Co-authored-by: Barry Warsaw <barry@python.org>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
GH-125208 is a backport of this pull request to the3.13 branch. |
…ributes (python#124709)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>Co-authored-by: Barry Warsaw <barry@python.org>Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>(cherry-picked from commit3024b16)
GH-125211 is a backport of this pull request to the3.12 branch. |
Note: thiscaused some reference warnings in the devguide via intersphinx by removing the |
Uh oh!
There was an error while loading.Please reload this page.
Our documentation for
ModuleType
attributes is currently quite scattered. Some attributes are documented in the data model; some in the reference guide for the import system; some in the API entry fortypes.ModuleType
; and some in the API entry forimportlib.abc.Loader.load_module
.Some attributes are documented in several of these places, but the different entries say different things about the same attribute!This PR consolidates documentation for these attributes into a single list of attributes in the datamodel docs. This is a similar approach to the one we use forattributes on class objects,attributes on function objects, andattributes on code objects. (Unlike those links, though, I haven't used a table for all module attributes, since some of the import-system-related attributes are described over the course of several paragraphs!)
I've tried to keep this PR as small as possible. Unfortunately, in order to not break existing cross references in the documentation, a number of other files have had to be updated as part of the same PR.
📚 Documentation preview 📚:https://cpython-previews--124709.org.readthedocs.build/