Skip to content

Commit 94d0199

Browse files
Move __cached__ deprecation notice to its own attribute section and clean up __file__ docs
1 parent 06b0920 commit 94d0199

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Doc/reference/datamodel.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,14 +1084,12 @@ this approach.
10841084
:ref:`import system <importsystem>` may opt to leave it unset if it
10851085
has no semantic meaning (for example, a module loaded from a database).
10861086

1087-
.. deprecated-removed:: 3.13 3.15
1088-
Setting ``__cached__`` on a module while failing to set
1089-
:attr:`!__spec__.cached` is deprecated. In Python 3.15,
1090-
``__cached__`` will cease to be set or taken into consideration by
1091-
the import system or standard library.
1087+
.. attribute:: module.__cached__
1088+
1089+
The ``__cached__`` attribute stores the path to the compiled byte‑code file for a module.
1090+
It is deprecated and will be removed in Python 3.15.
1091+
10921092

1093-
.. versionchanged:: 3.15
1094-
``__cached__`` is no longer set.
10951093

10961094
Other writable attributes on module objects
10971095
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)