@@ -129,8 +129,7 @@ Importing Modules
129129 of :class:`~importlib.machinery.SourceFileLoader` otherwise.
130130
131131 The module's :attr:`~module.__file__` attribute will be set to the code
132- object's :attr:`~codeobject.co_filename`. If applicable,
133- :attr:`~module.__cached__` will also be set.
132+ object's :attr:`~codeobject.co_filename`.
134133
135134 This function will reload the module if it was already imported. See
136135 :c:func:`PyImport_ReloadModule` for the intended way to reload a module.
@@ -142,10 +141,13 @@ Importing Modules
142141 :c:func:`PyImport_ExecCodeModuleWithPathnames`.
143142
144143 .. versionchanged:: 3.12
145- The setting of :attr:`~module. __cached__` and :attr:`~module.__loader__`
144+ The setting of `` __cached__` ` and :attr:`~module.__loader__`
146145 is deprecated. See :class:`~importlib.machinery.ModuleSpec` for
147146 alternatives.
148147
148+ .. versionchanged:: 3.15
149+ ``__cached__`` is no longer set.
150+
149151
150152.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
151153
@@ -157,16 +159,19 @@ Importing Modules
157159
158160.. c :function :: PyObject* PyImport_ExecCodeModuleObject (PyObject *name, PyObject *co, PyObject *pathname, PyObject *cpathname)
159161
160- Like :c:func: `PyImport_ExecCodeModuleEx `, but the :attr: ` ~module.__cached__ `
161- attribute of the module object is set to * cpathname * if it is
162- non-`` NULL ``. Of the three functions, this is the preferred one to use.
162+ Like :c:func: `PyImport_ExecCodeModuleEx `, but the path to any compiled file
163+ via * cpathname * is used appropriately when non-`` NULL ``. Of the three
164+ functions, this is the preferred one to use.
163165
164166 .. versionadded :: 3.3
165167
166168 .. versionchanged :: 3.12
167- Setting :attr: ` ~module. __cached__ ` is deprecated. See
169+ Setting `` __cached__ ` ` is deprecated. See
168170 :class: `~importlib.machinery.ModuleSpec ` for alternatives.
169171
172+ .. versionchanged :: 3.15
173+ ``__cached__ `` no longer set.
174+
170175
171176.. c :function :: PyObject* PyImport_ExecCodeModuleWithPathnames (const char *name, PyObject *co, const char *pathname, const char *cpathname)
172177
0 commit comments