Commit 742520be authored by Victor Stinner's avatar Victor Stinner

asyncio: document Task.current_task()

parent 2a446bf7
...@@ -273,6 +273,14 @@ Task ...@@ -273,6 +273,14 @@ Task
By default all tasks for the current event loop are returned. 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() .. method:: cancel()
Cancel the task. Cancel the task.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment