diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/import.rst | 9 | ||||
-rw-r--r-- | Doc/library/runpy.rst | 9 | ||||
-rw-r--r-- | Doc/whatsnew/3.12.rst | 4 |
3 files changed, 20 insertions, 2 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index 0922956..a51619d 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -150,6 +150,11 @@ Importing Modules See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:`PyImport_ExecCodeModuleWithPathnames`. + .. versionchanged:: 3.12 + The setting of :attr:`__cached__` and :attr:`__loader__` is + deprecated. See :class:`~importlib.machinery.ModuleSpec` for + alternatives. + .. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname) @@ -167,6 +172,10 @@ Importing Modules .. versionadded:: 3.3 + .. versionchanged:: 3.12 + Setting :attr:`__cached__` is deprecated. See + :class:`~importlib.machinery.ModuleSpec` for alternatives. + .. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname) diff --git a/Doc/library/runpy.rst b/Doc/library/runpy.rst index 26a4f14..501f4dd 100644 --- a/Doc/library/runpy.rst +++ b/Doc/library/runpy.rst @@ -93,6 +93,11 @@ The :mod:`runpy` module provides two functions: run this way, as well as ensuring the real module name is always accessible as ``__spec__.name``. + .. versionchanged:: 3.12 + The setting of ``__cached__``, ``__loader__``, and + ``__package__`` are deprecated. See + :class:`~importlib.machinery.ModuleSpec` for alternatives. + .. function:: run_path(path_name, init_globals=None, run_name=None) .. index:: @@ -163,6 +168,10 @@ The :mod:`runpy` module provides two functions: case where ``__main__`` is imported from a valid sys.path entry rather than being executed directly. + .. versionchanged:: 3.12 + The setting of ``__cached__``, ``__loader__``, and + ``__package__`` are deprecated. + .. seealso:: :pep:`338` -- Executing modules as scripts diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 507ba35..d18c31f 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -280,8 +280,8 @@ Pending Removal in Python 3.14 * Creating :c:data:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable bases using the C API. -* ``__package__`` will cease to be set or taken into consideration by - the import system (:gh:`97879`). +* ``__package__`` and ``__cached__`` will cease to be set or taken + into consideration by the import system (:gh:`97879`). Pending Removal in Future Versions |