Skip to content

Commit fa3ee75

Browse files
hauntsaninjahugovk
andauthored
[3.13] Postpone module.__loader__ deprecation to Python 3.16 (GH-126482) (#126638)
Postpone `module.__loader__` deprecation to Python 3.16 (#126482) (cherry picked from commit 450db61) Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 4e036d3 commit fa3ee75

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

Doc/deprecations/pending-removal-in-3.14.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
Pending Removal in Python 3.14
22
------------------------------
33

4-
* The import system:
5-
6-
* Setting :attr:`~module.__loader__` on a module while
7-
failing to set :attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>`
8-
is deprecated. In Python 3.14, :attr:`!__loader__` will cease to be set or
9-
taken into consideration by the import system or the standard library.
10-
114
* :mod:`argparse`: The *type*, *choices*, and *metavar* parameters
125
of :class:`!argparse.BooleanOptionalAction` are deprecated
136
and will be removed in 3.14.

Doc/deprecations/pending-removal-in-3.16.rst

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
Pending Removal in Python 3.16
1+
Pending removal in Python 3.16
22
------------------------------
33

4-
* :mod:`builtins`:
4+
* The import system:
55

6-
* Bitwise inversion on boolean types, ``~True`` or ``~False``
7-
has been deprecated since Python 3.12,
8-
as it produces surprising and unintuitive results (``-2`` and ``-1``).
9-
Use ``not x`` instead for the logical negation of a Boolean.
10-
In the rare case that you need the bitwise inversion of
11-
the underlying integer, convert to ``int`` explicitly (``~int(x)``).
6+
* Setting :attr:`~module.__loader__` on a module while
7+
failing to set :attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>`
8+
is deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or
9+
taken into consideration by the import system or the standard library.
1210

1311
* :mod:`array`:
1412

@@ -18,6 +16,22 @@ Pending Removal in Python 3.16
1816
Use the ``'w'`` format code (:c:type:`Py_UCS4`)
1917
for Unicode characters instead.
2018

19+
* :mod:`asyncio`:
20+
21+
* :func:`!asyncio.iscoroutinefunction` is deprecated
22+
and will be removed in Python 3.16,
23+
use :func:`inspect.iscoroutinefunction` instead.
24+
(Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)
25+
26+
* :mod:`builtins`:
27+
28+
* Bitwise inversion on boolean types, ``~True`` or ``~False``
29+
has been deprecated since Python 3.12,
30+
as it produces surprising and unintuitive results (``-2`` and ``-1``).
31+
Use ``not x`` instead for the logical negation of a Boolean.
32+
In the rare case that you need the bitwise inversion of
33+
the underlying integer, convert to ``int`` explicitly (``~int(x)``).
34+
2135
* :mod:`shutil`:
2236

2337
* The :class:`!ExecError` exception

Doc/reference/datamodel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,9 +1013,9 @@ this approach.
10131013
using the :class:`types.ModuleType` constructor.
10141014
Previously the attribute was optional.
10151015

1016-
.. deprecated-removed:: 3.12 3.14
1016+
.. deprecated-removed:: 3.12 3.16
10171017
Setting :attr:`!__loader__` on a module while failing to set
1018-
:attr:`!__spec__.loader` is deprecated. In Python 3.14,
1018+
:attr:`!__spec__.loader` is deprecated. In Python 3.16,
10191019
:attr:`!__loader__` will cease to be set or taken into consideration by
10201020
the import system or the standard library.
10211021

0 commit comments

Comments
 (0)