Skip to content

Commit dcec9b7

Browse files
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 0dcfe0f commit dcec9b7

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
@@ -540,27 +540,51 @@ New Modules
540540
Improved Modules
541541
================
542542

543+
.. _whatsnew311-asyncio:
544+
543545
asyncio
544546
-------
545547

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

565589
contextlib
566590
----------

0 commit comments

Comments
 (0)