gh-145299: Move __cached__ removal notice to its own attribute section#145324
Open
gourijain029-del wants to merge 2 commits intopython:mainfrom
Open
gh-145299: Move __cached__ removal notice to its own attribute section#145324gourijain029-del wants to merge 2 commits intopython:mainfrom
__cached__ removal notice to its own attribute section#145324gourijain029-del wants to merge 2 commits intopython:mainfrom
Conversation
…lean up __file__ docs
__cached__ removal notice to its own attribute section
| .. attribute:: module.__cached__ | ||
|
|
||
| The ``__cached__`` attribute stores the path to the compiled byte‑code file for a module. | ||
| It is deprecated and will be removed in Python 3.15. |
Member
There was a problem hiding this comment.
This makes no sense for the 3.15 docs, it has been removed?
__cached__ removal notice to its own attribute section__cached__ removal notice to its own attribute section
Adds regression test to verify lazy imports work correctly with modules that use __getattr__ for dynamic attributes (e.g. typing.Match). The issue appears to be already fixed in current main branch.
a4189c0 to
8ba32ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The cached attribute is being deprecated in Python 3.15.
In the current documentation the deprecation notice lives under the module.file entry, which is confusing for readers.
This change:
Adds a dedicated module.cached attribute section that clearly explains the purpose of the attribute and its deprecation schedule.
Removes the deprecation block from the module.file documentation, keeping that section focused on the file path only.
Keeps the wording concise and consistent with the style of the rest of the CPython docs, avoiding any “LLM‑generated” phrasing.
The update aligns the documentation with the actual behavior of the import system (the attribute is no longer set as of Python 3.15) and makes the deprecation information easier to find.
Fixes #145299
📚 Documentation preview 📚: https://cpython-previews--145324.org.readthedocs.build/