[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 450db61a78)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
Shantanu 2024-11-09 17:01:05 -08:00 committed by GitHub
parent 4e036d376e
commit fa3ee75e6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 18 deletions

View file

@ -1,13 +1,6 @@
Pending Removal in Python 3.14 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 * :mod:`argparse`: The *type*, *choices*, and *metavar* parameters
of :class:`!argparse.BooleanOptionalAction` are deprecated of :class:`!argparse.BooleanOptionalAction` are deprecated
and will be removed in 3.14. and will be removed in 3.14.

View file

@ -1,6 +1,28 @@
Pending Removal in Python 3.16 Pending removal in Python 3.16
------------------------------ ------------------------------
* 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.16, :attr:`!__loader__` will cease to be set or
taken into consideration by the import system or the standard library.
* :mod:`array`:
* The ``'u'`` format code (:c:type:`wchar_t`)
has been deprecated in documentation since Python 3.3
and at runtime since Python 3.13.
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`: * :mod:`builtins`:
* Bitwise inversion on boolean types, ``~True`` or ``~False`` * Bitwise inversion on boolean types, ``~True`` or ``~False``
@ -10,14 +32,6 @@ Pending Removal in Python 3.16
In the rare case that you need the bitwise inversion of In the rare case that you need the bitwise inversion of
the underlying integer, convert to ``int`` explicitly (``~int(x)``). the underlying integer, convert to ``int`` explicitly (``~int(x)``).
* :mod:`array`:
* The ``'u'`` format code (:c:type:`wchar_t`)
has been deprecated in documentation since Python 3.3
and at runtime since Python 3.13.
Use the ``'w'`` format code (:c:type:`Py_UCS4`)
for Unicode characters instead.
* :mod:`shutil`: * :mod:`shutil`:
* The :class:`!ExecError` exception * The :class:`!ExecError` exception

View file

@ -1013,9 +1013,9 @@ this approach.
using the :class:`types.ModuleType` constructor. using the :class:`types.ModuleType` constructor.
Previously the attribute was optional. 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 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 :attr:`!__loader__` will cease to be set or taken into consideration by
the import system or the standard library. the import system or the standard library.