Skip to content

Commit 9d49bd4

Browse files
miss-islingtongvanrossum
authored andcommitted
GH-95913: Update what's new in 3.11 for asyncio (GH-97806)
Co-authored-by: Kumar Aditya <[email protected]> Co-authored-by: C.A.M. Gerlach <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 9fbfa42) Co-authored-by: Guido van Rossum <[email protected]>
1 parent 7ddd0d3 commit 9d49bd4

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

Doc/whatsnew/3.11.rst

+40-16
Original file line numberDiff line numberDiff line change
@@ -522,27 +522,51 @@ New Modules
522522
Improved Modules
523523
================
524524

525+
.. _whatsnew311-asyncio:
526+
525527
asyncio
526528
-------
527529

528-
* Add raw datagram socket functions to the event loop:
529-
:meth:`~asyncio.AbstractEventLoop.sock_sendto`,
530-
:meth:`~asyncio.AbstractEventLoop.sock_recvfrom` and
531-
:meth:`~asyncio.AbstractEventLoop.sock_recvfrom_into`.
532-
(Contributed by Alex Grönholm in :issue:`46805`.)
533-
534-
* Add :meth:`~asyncio.streams.StreamWriter.start_tls` method for upgrading
535-
existing stream-based connections to TLS. (Contributed by Ian Good in
536-
:issue:`34975`.)
537-
538-
* Add :class:`~asyncio.Barrier` class to the synchronization primitives of
539-
the asyncio library. (Contributed by Yves Duprat and Andrew Svetlov in
540-
:gh:`87518`.)
541-
542-
* Add :class:`~asyncio.TaskGroup` class,
530+
* Added the :class:`~asyncio.TaskGroup` class,
543531
an :ref:`asynchronous context manager <async-context-managers>`
544532
holding a group of tasks that will wait for all of them upon exit.
545-
(Contributed by Yury Seliganov and others.)
533+
For new code this is recommended over using
534+
:func:`~asyncio.create_task` and :func:`~asyncio.gather` directly.
535+
(Contributed by Yury Selivanov and others in :gh:`90908`.)
536+
537+
* Added :func:`~asyncio.timeout`, an asynchronous context manager for
538+
setting a timeout on asynchronous operations. For new code this is
539+
recommended over using :func:`~asyncio.wait_for` directly.
540+
(Contributed by Andrew Svetlov in :gh:`90927`.)
541+
542+
* Added the :class:`~asyncio.Runner` class, which exposes the machinery
543+
used by :func:`~asyncio.run`.
544+
(Contributed by Andrew Svetlov in :gh:`91218`.)
545+
546+
* Added the :class:`~asyncio.Barrier` class to the synchronization
547+
primitives in the asyncio library, and the related
548+
:exc:`~asyncio.BrokenBarrierError` exception.
549+
(Contributed by Yves Duprat and Andrew Svetlov in :gh:`87518`.)
550+
551+
* Added keyword argument *all_errors* to :meth:`asyncio.loop.create_connection`
552+
so that multiple connection errors can be raised as an :exc:`ExceptionGroup`.
553+
554+
* Added the :meth:`asyncio.StreamWriter.start_tls` method for
555+
upgrading existing stream-based connections to TLS.
556+
(Contributed by Ian Good in :issue:`34975`.)
557+
558+
* Added raw datagram socket functions to the event loop:
559+
:meth:`~asyncio.loop.sock_sendto`,
560+
:meth:`~asyncio.loop.sock_recvfrom` and
561+
:meth:`~asyncio.loop.sock_recvfrom_into`.
562+
These have implementations in :class:`~asyncio.SelectorEventLoop` and
563+
:class:`~asyncio.ProactorEventLoop`.
564+
(Contributed by Alex Grönholm in :issue:`46805`.)
565+
566+
* Added :meth:`~asyncio.Task.cancelling` and
567+
:meth:`~asyncio.Task.uncancel` methods to :class:`~asyncio.Task`.
568+
These are primarily intended for internal use,
569+
notably by :class:`~asyncio.TaskGroup`.
546570

547571
contextlib
548572
----------

0 commit comments

Comments
 (0)