Skip to content

Commit 2866e03

Browse files
authored
gh-97696 Add documentation for get_coro() behavior with eager tasks (#104304)
1 parent c3b595e commit 2866e03

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Doc/library/asyncio-task.rst

+11
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,8 @@ Running Tasks Concurrently
527527
and there is no running event loop.
528528

529529

530+
.. _eager-task-factory:
531+
530532
Eager Task Factory
531533
==================
532534

@@ -1174,8 +1176,17 @@ Task Object
11741176

11751177
Return the coroutine object wrapped by the :class:`Task`.
11761178

1179+
.. note::
1180+
1181+
This will return ``None`` for Tasks which have already
1182+
completed eagerly. See the :ref:`Eager Task Factory <eager-task-factory>`.
1183+
11771184
.. versionadded:: 3.8
11781185

1186+
.. versionchanged:: 3.12
1187+
1188+
Newly added eager task execution means result may be ``None``.
1189+
11791190
.. method:: get_context()
11801191

11811192
Return the :class:`contextvars.Context` object

0 commit comments

Comments
 (0)