Co-authored-by: Joannah Nanjekye <jnanjekye@python.org>
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.
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