summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Doc/library/asyncio-future.rst3
-rw-r--r--Doc/library/asyncio-task.rst5
2 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/asyncio-future.rst b/Doc/library/asyncio-future.rst
index ef496a23f5..3496387c17 100644
--- a/Doc/library/asyncio-future.rst
+++ b/Doc/library/asyncio-future.rst
@@ -54,6 +54,9 @@ Future Functions
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.
+
.. versionchanged:: 3.5.1
The function accepts any :term:`awaitable` object.
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index fb86892547..f18b0e347b 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -274,6 +274,11 @@ Creating Tasks
task = asyncio.ensure_future(coro())
...
+ .. important::
+
+ Save a reference to the result of this function, to avoid
+ a task disappearing mid execution.
+
.. versionadded:: 3.7
.. versionchanged:: 3.8