FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-65961: Stop setting `__cached__` on modules by brettcannon · Pull Request #142165 · python/cpython · GitHub

/ cpython Public

GH-65961: Stop setting __cached__ on modules - #142165

Merged
brettcannon merged 4 commits into
python:mainfrom
brettcannon:remove-__cached__
Dec 11, 2025
Merged

GH-65961: Stop setting __cached__ on modules#142165
brettcannon merged 4 commits into
python:mainfrom
brettcannon:remove-__cached__

Conversation

brettcannon commented Dec 1, 2025
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Member

brettcannon self-assigned this Dec 2, 2025
brettcannon merged commit af18572 into python:main Dec 11, 2025
118 of 124 checks passed
brettcannon deleted the remove-__cached__ branch December 11, 2025 19:44
fatelei pushed a commit to fatelei/cpython that referenced this pull request Dec 12, 2025

DimitriPapadopoulos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@brettcannon This change puts the __cached__ deprecation notices under the __file__ attribute. I find this confusing::

instead of :attr:`!module.__path__`.

.. attribute:: module.__file__
.. attribute:: module.__cached__

DimitriPapadopoulos Feb 26, 2026
edited
Loading

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I can understand why module.__cached__ is removed here, but __cached__ remains implicitly referred to in ensuing deprecation notices.

:attr:`module.__spec__.cached <importlib.machinery.ModuleSpec.cached>`
instead of :attr:`!module.__cached__`.

.. deprecated-removed:: 3.13 3.15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Perhaps reintroduce attribute module.__cached__ here, or move the __cached__ deprecation notices elsewhere, not under module.__file__.

Copy link
Copy Markdown
Member Author

This change puts the __cached__ deprecation notices under the __file__ attribute. I find this confusing

That's a syntax mistake in the docs. Can you please open an issue?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL