Skip to content

Commit 7977354

Browse files
committed
GH-95913: Update what's new in 3.11 for asyncio
1 parent 00b5a08 commit 7977354

File tree

1 file changed

+32
-13
lines changed

1 file changed

+32
-13
lines changed

Doc/whatsnew/3.11.rst

+32-13
Original file line numberDiff line numberDiff line change
@@ -532,24 +532,43 @@ Improved Modules
532532
asyncio
533533
-------
534534

535-
* Add raw datagram socket functions to the event loop:
535+
* Added the :class:`~asyncio.TaskGroup` class,
536+
an :ref:`asynchronous context manager <async-context-managers>`
537+
holding a group of tasks that will wait for all of them upon exit.
538+
For new code this is recommended over using
539+
:class:`~asyncio.create_task` and :func:`~asyncio.gather` directly.
540+
(Contributed by Yury Seliganov and others in :gh:`90908`.)
541+
542+
* Added :func:`~asyncio.timeout`, an asynchronous context manager for
543+
setting a timeout on asynchronous operations For new code this is
544+
recommended over using :func:`~asyncio.wait_for` directly.
545+
(Contributed by Andrew Svetlov in :gh:`90927`.)
546+
547+
* Added the :class:`~asyncio.Runner` class, which exposes the machinery
548+
used by :func:`~asyncio.run`.
549+
(Contributed by Andrew Svetlov in :gh:`91218`.)
550+
551+
* Added the :class:`~asyncio.Barrier` class to the synchronization
552+
primitives in the asyncio library, and the related
553+
:exc:`~asyncio.BrokenBarrierError` exception.
554+
(Contributed by Yves Duprat and Andrew Svetlov in :gh:`87518`.)
555+
556+
* Added the :meth:`~asyncio.StreamWriter.start_tls` method for
557+
upgrading existing stream-based connections to TLS.
558+
(Contributed by Ian Good in :issue:`34975`.)
559+
560+
* Added raw datagram socket functions to the event loop:
536561
:meth:`~asyncio.AbstractEventLoop.sock_sendto`,
537562
:meth:`~asyncio.AbstractEventLoop.sock_recvfrom` and
538563
:meth:`~asyncio.AbstractEventLoop.sock_recvfrom_into`.
564+
These have implementations in :class:`~asyncio.SelectorEventLoop` and
565+
:class:`~asyncio.ProactorEventLoop`.
539566
(Contributed by Alex Grönholm in :issue:`46805`.)
540567

541-
* Add :meth:`~asyncio.streams.StreamWriter.start_tls` method for upgrading
542-
existing stream-based connections to TLS. (Contributed by Ian Good in
543-
:issue:`34975`.)
544-
545-
* Add :class:`~asyncio.Barrier` class to the synchronization primitives of
546-
the asyncio library. (Contributed by Yves Duprat and Andrew Svetlov in
547-
:gh:`87518`.)
548-
549-
* Add :class:`~asyncio.TaskGroup` class,
550-
an :ref:`asynchronous context manager <async-context-managers>`
551-
holding a group of tasks that will wait for all of them upon exit.
552-
(Contributed by Yury Seliganov and others.)
568+
* Added :meth:`~asyncio.Task.cancelling` and
569+
:meth:`~asyncio.Task.uncancel` methods to :class:`~asyncio.Task`.
570+
These are primarily intended for internal use,
571+
notably by :class:`~asyncio.TaskGroup`.
553572

554573
contextlib
555574
----------

0 commit comments

Comments
 (0)