@@ -540,27 +540,51 @@ New Modules
540
540
Improved Modules
541
541
================
542
542
543
+ .. _whatsnew311-asyncio :
544
+
543
545
asyncio
544
546
-------
545
547
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,
561
549
an :ref: `asynchronous context manager <async-context-managers >`
562
550
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 `.
564
588
565
589
contextlib
566
590
----------
0 commit comments