[Python-checkins] gh-97696 Add documentation for get_coro() behavior with eager tasks (#104304)
gvanrossum
webhook-mailer at python.org
Tue May 9 13:09:24 EDT 2023
https://github.com/python/cpython/commit/2866e030f01dc3ff08de32857fa77d52468b676b
commit: 2866e030f01dc3ff08de32857fa77d52468b676b
branch: main
author: Jacob Bower <1978924+jbower-fb at users.noreply.github.com>
committer: gvanrossum <gvanrossum at gmail.com>
date: 2023-05-09T10:09:16-07:00
summary:
gh-97696 Add documentation for get_coro() behavior with eager tasks (#104304)
files:
M Doc/library/asyncio-task.rst
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
index b2d7362a9de2..fe8d02815040 100644
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -527,6 +527,8 @@ Running Tasks Concurrently
and there is no running event loop.
+.. _eager-task-factory:
+
Eager Task Factory
==================
@@ -1174,8 +1176,17 @@ Task Object
Return the coroutine object wrapped by the :class:`Task`.
+ .. note::
+
+ This will return ``None`` for Tasks which have already
+ completed eagerly. See the :ref:`Eager Task Factory <eager-task-factory>`.
+
.. versionadded:: 3.8
+ .. versionchanged:: 3.12
+
+ Newly added eager task execution means result may be ``None``.
+
.. method:: get_context()
Return the :class:`contextvars.Context` object
More information about the Python-checkins
mailing list