gh-129169: update asyncio.ensure_future docs to suggest taskgroups

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
Case Zumbrum 2025-04-13 03:59:22 -04:00 committed by GitHub
parent 9d127e83b9
commit 00cf5eacc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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.