From 742520be43d0c63a5e121583068d9f720ba76660 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 10 Dec 2013 12:14:50 +0100 Subject: [PATCH] asyncio: document Task.current_task() --- Doc/library/asyncio-task.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 5769e91520..9581188e0e 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -273,6 +273,14 @@ Task By default all tasks for the current event loop are returned. + .. classmethod:: current_task(loop=None) + + Return the currently running task in an event loop or ``None``. + + By default the current task for the current event loop is returned. + + ``None`` is returned when called not in the context of a :class:`Task`. + .. method:: cancel() Cancel the task. -- 2.40.0