]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-129169: update `asyncio.ensure_future` docs to suggest taskgroups
authorCase Zumbrum <51789445+CaseZumbrum@users.noreply.github.com>
Sun, 13 Apr 2025 07:59:22 +0000 (03:59 -0400)
committerGitHub <noreply@github.com>
Sun, 13 Apr 2025 07:59:22 +0000 (07:59 +0000)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/library/asyncio-future.rst

index 9dce073141194013f2b636faa227e79edc9caa1f..32771ba72e000267a57a3e59005e13e6aea32eee 100644 (file)
@@ -51,12 +51,13 @@ Future Functions
 
    .. important::
 
-      See also the :func:`create_task` function which is the
-      preferred way for creating new Tasks.
-
       Save a reference to the result of this function, to avoid
       a task disappearing mid-execution.
 
+      See also the :func:`create_task` function which is the
+      preferred way for creating new tasks or use :class:`asyncio.TaskGroup`
+      which keeps reference to the task internally.
+
    .. versionchanged:: 3.5.1
       The function accepts any :term:`awaitable` object.