Skip to content

Commit 0f9c567

Browse files
authored
[3.13] GH-109975: Copyedit 3.13 What's New: New Deprecations (GH-123845) (#124135)
. (cherry picked from commit 05235e3)
1 parent b2ffd49 commit 0f9c567

File tree

3 files changed

+267
-175
lines changed

3 files changed

+267
-175
lines changed
+59-48
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,68 @@
11
Pending Removal in Python 3.15
22
------------------------------
33

4-
* :class:`http.server.CGIHTTPRequestHandler` will be removed along with its
5-
related ``--cgi`` flag to ``python -m http.server``. It was obsolete and
6-
rarely used. No direct replacement exists. *Anything* is better than CGI
7-
to interface a web server with a request handler.
8-
9-
* :class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python 3.11
10-
and originally planned for removal in Python 3.13 (:gh:`90817`),
11-
but removal has been postponed to Python 3.15.
12-
Use :func:`locale.setlocale`, :func:`locale.getencoding` and
13-
:func:`locale.getlocale` instead.
14-
(Contributed by Hugo van Kemenade in :gh:`111187`.)
4+
* :mod:`ctypes`:
5+
6+
* The undocumented :func:`!ctypes.SetPointerType` function
7+
has been deprecated since Python 3.13.
8+
9+
* :mod:`http.server`:
10+
11+
* The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler`
12+
has been deprecated since Python 3.13.
13+
No direct replacement exists.
14+
*Anything* is better than CGI to interface
15+
a web server with a request handler.
16+
17+
* The :option:`!--cgi` flag to the :program:`python -m http.server`
18+
command-line interface has been deprecated since Python 3.13.
19+
20+
* :class:`locale`:
21+
22+
* The :func:`~locale.getdefaultlocale` function
23+
has been deprecated since Python 3.11.
24+
Its removal was originally planned for Python 3.13 (:gh:`90817`),
25+
but has been postponed to Python 3.15.
26+
Use :func:`~locale.getlocale`, :func:`~locale.setlocale`,
27+
and :func:`~locale.getencoding` instead.
28+
(Contributed by Hugo van Kemenade in :gh:`111187`.)
1529

1630
* :mod:`pathlib`:
17-
:meth:`pathlib.PurePath.is_reserved` is deprecated and scheduled for
18-
removal in Python 3.15. Use :func:`os.path.isreserved` to detect reserved
19-
paths on Windows.
31+
32+
* :meth:`.PurePath.is_reserved`
33+
has been deprecated since Python 3.13.
34+
Use :func:`os.path.isreserved` to detect reserved paths on Windows.
2035

2136
* :mod:`platform`:
22-
:func:`~platform.java_ver` is deprecated and will be removed in 3.15.
23-
It was largely untested, had a confusing API,
24-
and was only useful for Jython support.
25-
(Contributed by Nikita Sobolev in :gh:`116349`.)
37+
38+
* :func:`~platform.java_ver` has been deprecated since Python 3.13.
39+
This function is only useful for Jython support, has a confusing API,
40+
and is largely untested.
2641

2742
* :mod:`threading`:
28-
Passing any arguments to :func:`threading.RLock` is now deprecated.
29-
C version allows any numbers of args and kwargs,
30-
but they are just ignored. Python version does not allow any arguments.
31-
All arguments will be removed from :func:`threading.RLock` in Python 3.15.
32-
(Contributed by Nikita Sobolev in :gh:`102029`.)
33-
34-
* :class:`typing.NamedTuple`:
35-
36-
* The undocumented keyword argument syntax for creating :class:`!NamedTuple` classes
37-
(``NT = NamedTuple("NT", x=int)``) is deprecated, and will be disallowed in
38-
3.15. Use the class-based syntax or the functional syntax instead.
39-
40-
* When using the functional syntax to create a :class:`!NamedTuple` class, failing to
41-
pass a value to the *fields* parameter (``NT = NamedTuple("NT")``) is
42-
deprecated. Passing ``None`` to the *fields* parameter
43-
(``NT = NamedTuple("NT", None)``) is also deprecated. Both will be
44-
disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 fields, use
45-
``class NT(NamedTuple): pass`` or ``NT = NamedTuple("NT", [])``.
46-
47-
* :class:`typing.TypedDict`: When using the functional syntax to create a
48-
:class:`!TypedDict` class, failing to pass a value to the *fields* parameter (``TD =
49-
TypedDict("TD")``) is deprecated. Passing ``None`` to the *fields* parameter
50-
(``TD = TypedDict("TD", None)``) is also deprecated. Both will be disallowed
51-
in Python 3.15. To create a :class:`!TypedDict` class with 0 fields, use ``class
52-
TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``.
53-
54-
* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()``
55-
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes.
56-
They will be removed in Python 3.15.
57-
(Contributed by Victor Stinner in :gh:`105096`.)
43+
44+
* :func:`~threading.RLock` will take no arguments in Python 3.15.
45+
Passing any arguments has been deprecated since Python 3.14,
46+
as the Python version does not permit any arguments,
47+
but the C version allows any number of positional or keyword arguments,
48+
ignoring every argument.
49+
50+
* :mod:`typing`:
51+
52+
* The undocumented keyword argument syntax for creating
53+
:class:`~typing.NamedTuple` classes
54+
(e.g. ``Point = NamedTuple("Point", x=int, y=int)``)
55+
has been deprecated since Python 3.13.
56+
Use the class-based syntax or the functional syntax instead.
57+
58+
* The :func:`typing.no_type_check_decorator` decorator function
59+
has been deprecated since Python 3.13.
60+
After eight years in the :mod:`typing` module,
61+
it has yet to be supported by any major type checker.
62+
63+
* :mod:`wave`:
64+
65+
* The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`,
66+
and :meth:`~wave.Wave_read.getmarkers` methods of
67+
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
68+
have been deprecated since Python 3.13.
+35-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
11
Pending Removal in Python 3.16
22
------------------------------
33

4+
* :mod:`builtins`:
5+
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)``).
12+
413
* :mod:`array`:
5-
:class:`array.array` ``'u'`` type (:c:type:`wchar_t`):
6-
use the ``'w'`` type instead (``Py_UCS4``).
714

8-
* :mod:`builtins`:
9-
``~bool``, bitwise inversion on bool.
15+
* The ``'u'`` format code (:c:type:`wchar_t`)
16+
has been deprecated in documentation since Python 3.3
17+
and at runtime since Python 3.13.
18+
Use the ``'w'`` format code (:c:type:`Py_UCS4`)
19+
for Unicode characters instead.
20+
21+
* :mod:`shutil`:
22+
23+
* The :class:`!ExecError` exception
24+
has been deprecated since Python 3.14.
25+
It has not been used by any function in :mod:`!shutil` since Python 3.4,
26+
and is now an alias of :exc:`RuntimeError`.
1027

1128
* :mod:`symtable`:
12-
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest.
13-
(Contributed by Bénédikt Tran in :gh:`119698`.)
29+
30+
* The :meth:`Class.get_methods <symtable.Class.get_methods>` method
31+
has been deprecated since Python 3.14.
32+
33+
* :mod:`sys`:
34+
35+
* The :func:`~sys._enablelegacywindowsfsencoding` function
36+
has been deprecated since Python 3.13.
37+
Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead.
38+
39+
* :mod:`tarfile`:
40+
41+
* The undocumented and unused :attr:`!TarFile.tarfile` attribute
42+
has been deprecated since Python 3.13.

0 commit comments

Comments
 (0)