Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/c-api/import.rst
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
7 changes: 0 additions & 7 deletions Doc/deprecations/pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
Pending removal in Python 3.15
------------------------------

* The import system:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These entries usually stay, they aren't removed. In older What's New entries the deprecation will now be missing.


* Setting ``__cached__`` on a module while
failing to set :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>`
is deprecated. In Python 3.15, ``__cached__`` will cease to be set or
take into consideration by the import system or standard library. (:gh:`97879`)

* :mod:`ctypes`:

* The undocumented :func:`!ctypes.SetPointerType` function
Expand Down
4 changes: 2 additions & 2 deletions Doc/library/runpy.rst
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
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
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