-
-
Notifications
You must be signed in to change notification settings - Fork 32k
GH-109975: Copyedit 3.13 What's New: New Deprecations #123845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,68 @@ | ||
Pending Removal in Python 3.15 | ||
------------------------------ | ||
|
||
* :class:`http.server.CGIHTTPRequestHandler` will be removed along with its | ||
related ``--cgi`` flag to ``python -m http.server``. It was obsolete and | ||
rarely used. No direct replacement exists. *Anything* is better than CGI | ||
to interface a web server with a request handler. | ||
|
||
* :class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python 3.11 | ||
and originally planned for removal in Python 3.13 (:gh:`90817`), | ||
but removal has been postponed to Python 3.15. | ||
Use :func:`locale.setlocale`, :func:`locale.getencoding` and | ||
:func:`locale.getlocale` instead. | ||
(Contributed by Hugo van Kemenade in :gh:`111187`.) | ||
* :mod:`ctypes`: | ||
|
||
* The undocumented :func:`!ctypes.SetPointerType` function | ||
has been deprecated since Python 3.13. | ||
|
||
* :mod:`http.server`: | ||
|
||
* The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` | ||
has been deprecated since Python 3.13. | ||
No direct replacement exists. | ||
10000 | *Anything* is better than CGI to interface | |
a web server with a request handler. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* The :option:`!--cgi` flag to the :program:`python -m http.server` | ||
command-line interface has been deprecated since Python 3.13. | ||
|
||
* :class:`locale`: | ||
|
||
* The :func:`~locale.getdefaultlocale` function | ||
has been deprecated since Python 3.11. | ||
Its removal was originally planned for Python 3.13 (:gh:`90817`), | ||
but has been postponed to Python 3.15. | ||
Use :func:`~locale.getlocale`, :func:`~locale.setlocale`, | ||
and :func:`~locale.getencoding` instead. | ||
(Contributed by Hugo van Kemenade in :gh:`111187`.) | ||
|
||
* :mod:`pathlib`: | ||
:meth:`pathlib.PurePath.is_reserved` is deprecated and scheduled for | ||
removal in Python 3.15. Use :func:`os.path.isreserved` to detect reserved | ||
paths on Windows. | ||
|
||
* :meth:`.PurePath.is_reserved` | ||
has been deprecated since Python 3.13. | ||
Use :func:`os.path.isreserved` to detect reserved paths on Windows. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* :mod:`platform`: | ||
:func:`~platform.java_ver` is deprecated and will be removed in 3.15. | ||
It was largely untested, had a confusing API, | ||
and was only useful for Jython support. | ||
(Contributed by Nikita Sobolev in :gh:`116349`.) | ||
|
||
* :func:`~platform.java_ver` has been deprecated since Python 3.13. | ||
This function is only useful for Jython support, has a confusing API, | ||
and is largely untested. | ||
AA-Turner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* :mod:`threading`: | ||
Passing any arguments to :func:`threading.RLock` is now deprecated. | ||
C version allows any numbers of args and kwargs, | ||
but they are just ignored. Python version does not allow any arguments. | ||
All arguments will be removed from :func:`threading.RLock` in Python 3.15. | ||
(Contributed by Nikita Sobolev in :gh:`102029`.) | ||
|
||
* :class:`typing.NamedTuple`: | ||
|
||
* The undocumented keyword argument syntax for creating :class:`!NamedTuple` classes | ||
(``NT = NamedTuple("NT", x=int)``) is deprecated, and will be disallowed in | ||
3.15. Use the class-based syntax or the functional syntax instead. | ||
|
||
* When using the functional syntax to create a :class:`!NamedTuple` class, failing to | ||
pass a value to the *fields* parameter (``NT = NamedTuple("NT")``) is | ||
deprecated. Passing ``None`` to the *fields* parameter | ||
(``NT = NamedTuple("NT", None)``) is also deprecated. Both will be | ||
disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 fields, use | ||
``class NT(NamedTuple): pass`` or ``NT = NamedTuple("NT", [])``. | ||
|
||
* :class:`typing.TypedDict`: When using the functional syntax to create a | ||
:class:`!TypedDict` class, failing to pass a value to the *fields* parameter (``TD = | ||
TypedDict("TD")``) is deprecated. Passing ``None`` to the *fields* parameter | ||
(``TD = TypedDict("TD", None)``) is also deprecated. Both will be disallowed | ||
in Python 3.15. To create a :class:`!TypedDict` class with 0 fields, use ``class | ||
TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``. | ||
|
||
* :mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` | ||
methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. | ||
They will be removed in Python 3.15. | ||
(Contributed by Victor Stinner in :gh:`105096`.) | ||
|
||
* :func:`~threading.RLock` will take no arguments in Python 3.15. | ||
Passing any arguments has been deprecated since Python 3.14, | ||
as the Python version does not permit any arguments, | ||
but the C version allows any number of positional or keyword arguments, | ||
ignoring every argument. | ||
|
||
* :mod:`typing`: | ||
|
||
* The undocumented keyword argument syntax for creating | ||
:class:`~typing.NamedTuple` classes | ||
(e.g. ``Point = NamedTuple("Point", x=int, y=int)``) | ||
has been deprecated since Python 3.13. | ||
Use the class-based syntax or the functional syntax instead. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* The :func:`typing.no_type_check_decorator` decorator function | ||
has been deprecated since Python 3.13. | ||
After eight years in the :mod:`typing` module, | ||
it has yet to be supported by any major type checker. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* :mod:`wave`: | ||
|
||
* The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, | ||
and :meth:`~wave.Wave_read.getmarkers` methods of | ||
the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes | ||
have been deprecated since Python 3.13. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
Pending Removal in Python 3.16 | ||
------------------------------ | ||
|
||
* :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:`array`: | ||
:class:`array.array` ``'u'`` type (:c:type:`wchar_t`): | ||
use the ``'w'`` type instead (``Py_UCS4``). | ||
|
||
* :mod:`builtins`: | ||
``~bool``, bitwise inversion on bool. | ||
* 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`: | ||
|
||
* The :class:`!ExecError` exception | ||
has been deprecated since Python 3.14. | ||
It has not been used by any function in :mod:`!shutil` since Python 3.4, | ||
and is now an alias of :exc:`RuntimeError`. | ||
|
||
* :mod:`symtable`: | ||
Deprecate :meth:`symtable.Class.get_methods` due to the lack of interest. | ||
(Contributed by Bénédikt Tran in :gh:`119698`.) | ||
|
||
* :mod:`shutil`: Deprecate :class:`!shutil.ExecError`, which hasn't | ||
been raised by any :mod:`!shutil` function since Python 3.4. It's | ||
now an alias for :exc:`RuntimeError`. | ||
* The :meth:`Class.get_methods <symtable.Class.get_methods>` method | ||
has been deprecated since Python 3.14. | ||
|
||
* :mod:`sys`: | ||
|
||
* The :func:`~sys._enablelegacywindowsfsencoding` function | ||
has been deprecated since Python 3.13. | ||
Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* :mod:`tarfile`: | ||
|
||
* The undocumented and unused :attr:`!TarFile.tarfile` attribute | ||
has been deprecated since Python 3.13. | ||
hugovk marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.