]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-97696 Add documentation for get_coro() behavior with eager tasks (#104304)
authorJacob Bower <1978924+jbower-fb@users.noreply.github.com>
Tue, 9 May 2023 17:09:16 +0000 (10:09 -0700)
committerGitHub <noreply@github.com>
Tue, 9 May 2023 17:09:16 +0000 (10:09 -0700)
Doc/library/asyncio-task.rst

index b2d7362a9de213e9c567e054fccfd9018a3e7e90..fe8d028150403d0dfee1782a3814667a8ac199f2 100644 (file)
@@ -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