From: Victor Stinner Date: Tue, 10 Dec 2013 11:14:50 +0000 (+0100) Subject: asyncio: document Task.current_task() X-Git-Tag: v3.4.0b2~267 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=742520be43d0c63a5e121583068d9f720ba76660;p=thirdparty%2FPython%2Fcpython.git asyncio: document Task.current_task() --- diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 5769e9152010..9581188e0e5b 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.