Skip to content

Commit

Permalink
gh-97696 Add documentation for get_coro() behavior with eager tasks (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbower-fb authored May 9, 2023
1 parent c3b595e commit 2866e03
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ Running Tasks Concurrently
and there is no running event loop.


.. _eager-task-factory:

Eager Task Factory
==================

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2866e03

Please sign in to comment.