From: Case Zumbrum <51789445+CaseZumbrum@users.noreply.github.com> Date: Sun, 13 Apr 2025 07:59:22 +0000 (-0400) Subject: gh-129169: update `asyncio.ensure_future` docs to suggest taskgroups X-Git-Tag: v3.14.0b1~504 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00cf5eacc52d4790c23a24c835fb6b048cb27d8c;p=thirdparty%2FPython%2Fcpython.git gh-129169: update `asyncio.ensure_future` docs to suggest taskgroups Co-authored-by: Kumar Aditya --- diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst index 9dce07314119..32771ba72e00 100644 --- a/Doc/library/asyncio-future.rst +++ b/Doc/library/asyncio-future.rst @@ -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.