]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Postpone `module.__loader__` deprecation to Python 3.16 (GH-126482) (#126638)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Sun, 10 Nov 2024 01:01:05 +0000 (17:01 -0800)
committerGitHub <noreply@github.com>
Sun, 10 Nov 2024 01:01:05 +0000 (01:01 +0000)
Postpone `module.__loader__` deprecation to Python 3.16 (#126482)

(cherry picked from commit 450db61a78989c5a1f1106be01e071798c783cf9)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc/deprecations/pending-removal-in-3.14.rst
Doc/deprecations/pending-removal-in-3.16.rst
Doc/reference/datamodel.rst

index 5c07c1122fa6153fd3cb5eb967decb1bac756cbd..15606f61cf8b0caace50defbae1581734bc67eb2 100644 (file)
@@ -1,13 +1,6 @@
 Pending Removal in Python 3.14
 ------------------------------
 
-* The import system:
-
-  * Setting :attr:`~module.__loader__` on a module while
-    failing to set :attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>`
-    is deprecated. In Python 3.14, :attr:`!__loader__` will cease to be set or
-    taken into consideration by the import system or the standard library.
-
 * :mod:`argparse`: The *type*, *choices*, and *metavar* parameters
   of :class:`!argparse.BooleanOptionalAction` are deprecated
   and will be removed in 3.14.
index 446cc63cb34ff9e25bd2ee65609eeee12b15163e..6f6954b783a1aebc07e7527d8b51243b0d0bfa77 100644 (file)
@@ -1,14 +1,12 @@
-Pending Removal in Python 3.16
+Pending removal in Python 3.16
 ------------------------------
 
-* :mod:`builtins`:
+* The import system:
 
-  * Bitwise inversion on boolean types, ``~True`` or ``~False``
-    has been deprecated since Python 3.12,
-    as it produces surprising and unintuitive results (``-2`` and ``-1``).
-    Use ``not x`` instead for the logical negation of a Boolean.
-    In the rare case that you need the bitwise inversion of
-    the underlying integer, convert to ``int`` explicitly (``~int(x)``).
+  * Setting :attr:`~module.__loader__` on a module while
+    failing to set :attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>`
+    is deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or
+    taken into consideration by the import system or the standard library.
 
 * :mod:`array`:
 
@@ -18,6 +16,22 @@ Pending Removal in Python 3.16
     Use the ``'w'`` format code (:c:type:`Py_UCS4`)
     for Unicode characters instead.
 
+* :mod:`asyncio`:
+
+  * :func:`!asyncio.iscoroutinefunction` is deprecated
+    and will be removed in Python 3.16,
+    use :func:`inspect.iscoroutinefunction` instead.
+    (Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)
+
+* :mod:`builtins`:
+
+  * Bitwise inversion on boolean types, ``~True`` or ``~False``
+    has been deprecated since Python 3.12,
+    as it produces surprising and unintuitive results (``-2`` and ``-1``).
+    Use ``not x`` instead for the logical negation of a Boolean.
+    In the rare case that you need the bitwise inversion of
+    the underlying integer, convert to ``int`` explicitly (``~int(x)``).
+
 * :mod:`shutil`:
 
   * The :class:`!ExecError` exception
index ec338e75aaae7c54dc2c7e946384ccbaba97c9cd..819126dab70e9bd90cc70cc96d4d1e94e12e2879 100644 (file)
@@ -1013,9 +1013,9 @@ this approach.
       using the :class:`types.ModuleType` constructor.
       Previously the attribute was optional.
 
-   .. deprecated-removed:: 3.12 3.14
+   .. deprecated-removed:: 3.12 3.16
       Setting :attr:`!__loader__` on a module while failing to set
-      :attr:`!__spec__.loader` is deprecated. In Python 3.14,
+      :attr:`!__spec__.loader` is deprecated. In Python 3.16,
       :attr:`!__loader__` will cease to be set or taken into consideration by
       the import system or the standard library.