| 1 |
Pending removal in Python 3.16 |
| 2 |
------------------------------ |
| 3 |
|
| 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.16, :attr:`!__loader__` will cease to be set or |
| 9 |
taken into consideration by the import system or the standard library. |
| 10 |
|
| 11 |
* :mod:`array`: |
| 12 |
|
| 13 |
* The ``'u'`` format code (:c:type:`wchar_t`) |
| 14 |
has been deprecated in documentation since Python 3.3 |
| 15 |
and at runtime since Python 3.13. |
| 16 |
Use the ``'w'`` format code (:c:type:`Py_UCS4`) |
| 17 |
for Unicode characters instead. |
| 18 |
|
| 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 |
|
| 35 |
* :mod:`shutil`: |
| 36 |
|
| 37 |
* The :class:`!ExecError` exception |
| 38 |
has been deprecated since Python 3.14. |
| 39 |
It has not been used by any function in :mod:`!shutil` since Python 3.4, |
| 40 |
and is now an alias of :exc:`RuntimeError`. |
| 41 |
|
| 42 |
* :mod:`symtable`: |
| 43 |
|
| 44 |
* The :meth:`Class.get_methods <symtable.Class.get_methods>` method |
| 45 |
has been deprecated since Python 3.14. |
| 46 |
|
| 47 |
* :mod:`sys`: |
| 48 |
|
| 49 |
* The :func:`~sys._enablelegacywindowsfsencoding` function |
| 50 |
has been deprecated since Python 3.13. |
| 51 |
Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead. |
| 52 |
|
| 53 |
* :mod:`tarfile`: |
| 54 |
|
| 55 |
* The undocumented and unused :attr:`!TarFile.tarfile` attribute |
| 56 |
has been deprecated since Python 3.13. |