-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
GH-109190: Copyedit 3.12 What's New: Deprecations #109766
Conversation
* The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, | ||
:class:`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` | ||
and :class:`asyncio.SafeChildWatcher` are deprecated and | ||
will be removed in Python 3.14. It is recommended to not manually | ||
configure a child watcher as the event loop now uses the best available | ||
child watcher for each platform (:class:`asyncio.PidfdChildWatcher` | ||
if supported and :class:`asyncio.ThreadedChildWatcher` otherwise). | ||
(Contributed by Kumar Aditya in :gh:`94597`.) | ||
|
||
* :func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, | ||
:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` and | ||
:meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated | ||
and will be removed in Python 3.14. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncio
had two deprecations noted in "Improved Modules", these have been moved
* :mod:`argparse`: The *type*, *choices*, and *metavar* parameters | ||
of :class:`!argparse.BooleanOptionalAction` are deprecated | ||
and will be removed in 3.14. | ||
(Contributed by Nikita Sobolev in :gh:`92248`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from Pending Removal
* :mod:`ast`: The following :mod:`ast` features have been deprecated in documentation since | ||
Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at runtime | ||
when they are accessed or used, and will be removed in Python 3.14: | ||
|
||
* :class:`!ast.Num` | ||
* :class:`!ast.Str` | ||
* :class:`!ast.Bytes` | ||
* :class:`!ast.NameConstant` | ||
* :class:`!ast.Ellipsis` | ||
|
||
Use :class:`ast.Constant` instead. | ||
(Contributed by Serhiy Storchaka in :gh:`90953`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from Pending Removal
* :mod:`asyncio`: | ||
|
||
* The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, | ||
:class:`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` | ||
and :class:`asyncio.SafeChildWatcher` are deprecated and | ||
will be removed in Python 3.14. | ||
(Contributed by Kumar Aditya in :gh:`94597`.) | ||
|
||
* :func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, | ||
:meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` and | ||
:meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated | ||
and will be removed in Python 3.14. | ||
(Contributed by Kumar Aditya in :gh:`94597`.) | ||
|
||
* The :meth:`~asyncio.get_event_loop` method of the | ||
default event loop policy now emits a :exc:`DeprecationWarning` if there | ||
is no current event loop set and it decides to create one. | ||
(Contributed by Serhiy Storchaka and Guido van Rossum in :gh:`100160`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1) and (2) copied from Improved Modules, (3) copied from Pending Removal. Note that I've deleted the entry for asyncio.Future.cancel
& asyncio.Task.cancel
as it was reverted in #97999
* :mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. | ||
Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. | ||
For use in typing, prefer a union, like ``bytes | bytearray``, or :class:`collections.abc.Buffer`. | ||
(Contributed by Shantanu Jain in :gh:`91896`.) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from Pending Removal
* The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() | ||
<coroutine.throw>`, :meth:`generator throw() <generator.throw>` and | ||
:meth:`async generator throw() <agen.athrow>` are deprecated and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added explicit titles to avoid the text saying throw()
, throw()
, and athrow()
* Setting ``__package__`` or ``__cached__`` on a module is deprecated, | ||
and will cease to be set or taken into consideration by the import system in Python 3.14. | ||
(Contributed by Brett Cannon in :gh:`65961`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrased from Pending Removal
@@ -1116,9 +1200,14 @@ Deprecated | |||
* The bitwise inversion operator (``~``) on bool is deprecated. It will throw an | |||
error in Python 3.14. Use ``not`` for logical negation of bools instead. | |||
In the rare case that you really need the bitwise inversion of the underlying | |||
``int``, convert to int explicitly with ``~int(x)``. (Contributed by Tim Hoffmann | |||
``int``, convert to int explicitly: ``~int(x)``. (Contributed by Tim Hoffmann |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style -- this is both the conversion and inversion, so don't say "with"
* Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :pep:`626`, | ||
but it only got a proper :exc:`DeprecationWarning` in 3.12, | ||
therefore it will be removed in 3.14. | ||
(Contributed by Nikita Sobolev in :gh:`101866`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrased from Pending Removal
The following APIs have been deprecated | ||
and will be removed in Python 3.14. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapted from the Pending Removal in Python 3.13 summary
# Conflicts: # Doc/whatsnew/3.12.rst
# Conflicts: # Doc/whatsnew/3.12.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well; pushed a commit. A |
Thanks @AA-Turner for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
) (cherry picked from commit 87ddfa7) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
GH-109925 is a backport of this pull request to the 3.12 branch. |
…109925) * GH-109190: Copyedit 3.12 What's New: Deprecations (GH-109766) (cherry picked from commit 87ddfa7) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> * GH-109190: Copyedit 3.12 What's New: Deprecations (``os`` fix) (#109927) Merge the two ``os`` entries (cherry picked from commit 0e28d0f) --------- Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Sorry in advance for the large PR.
The main change here is ensuring that every deprecated API is listed under the "Deprecated" section. Previously, some deprecations were only listed under "Deprecated", some were listed under the "Pending Removal in Python 3.14" subheading, and some were listed under both. This was a confusing state of affairs, and unhelpful to readers. From this PR, the "Pending Removal in Python 3.14" section becomes a short list of APIs pending removal, reflecting the layout of the similar "3.13" and "Future Versions" sections.
A
📚 Documentation preview 📚: https://cpython-previews--109766.org.readthedocs.build/en/109766/whatsnew/3.12.html#deprecated