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

[3.15] gh-65961: Document __cached__ removal in What's New & clarify references to it (GH-156053) by miss-islington · Pull Request #156123 · python/cpython · GitHub

/ cpython Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Doc/c-api/import.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Importing Modules
alternatives.

.. versionchanged:: 3.15
``__cached__`` is no longer set.
The ``__cached__`` attribute is no longer set.


.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
Expand All @@ -170,7 +170,7 @@ Importing Modules
:class:`~importlib.machinery.ModuleSpec` for alternatives.

.. versionchanged:: 3.15
``__cached__`` no longer set.
The ``__cached__`` attribute no longer set.


.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/runpy.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The :mod:`!runpy` module provides two functions:
:class:`~importlib.machinery.ModuleSpec` for alternatives.

.. versionchanged:: 3.15
``__cached__`` is no longer set.
The global variable ``__cached__`` is no longer set.

.. function:: run_path(path_name, init_globals=None, run_name=None)

Expand Down Expand Up @@ -175,7 +175,7 @@ The :mod:`!runpy` module provides two functions:
``__package__`` are deprecated.

.. versionchanged:: 3.15
``__cached__`` is no longer set.
The global variable ``__cached__`` is no longer set.

.. seealso::

Expand Down
11 changes: 3 additions & 8 deletions Doc/reference/datamodel.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -1099,14 +1099,9 @@ this approach.
:ref:`import system <importsystem>` may opt to leave it unset if it
has no semantic meaning (for example, a module loaded from a database).

.. deprecated-removed:: 3.13 3.15
Setting ``__cached__`` on a module while failing to set
:attr:`!__spec__.cached` is deprecated. In Python 3.15,
``__cached__`` will cease to be set or taken into consideration by
the import system or standard library.

.. versionchanged:: 3.15
``__cached__`` is no longer set.
.. versionchanged:: 3.15
The ``__cached__`` attribute is no longer set on modules or taken into
consideration by the import system or standard library.

Other writable attributes on module objects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
8 changes: 8 additions & 0 deletions Doc/whatsnew/3.15.rst
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
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,14 @@ Other language changes
other, as regular dynamic extensions do.
(Contributed by Stefano Rivera in :gh:`122931`.)

* The ``__cached__`` attribute on modules, which was deprecated since version
3.13, is no longer set or taken into consideration by the import system or
standard library.
Use :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>` instead.
(Contributed by Brett Cannon in :gh:`97879`)

Note that the :attr:`~module.__loader__` and :attr:`~module.__package__`
attributes are also deprecated and scheduled for removal.


Default interactive shell
Expand Down
Loading

Back | FazBrowse Home | New Git URL