asyncio: document Task.current_task()

This commit is contained in:
Victor Stinner 2013-12-10 12:14:50 +01:00
parent 2a446bf76c
commit 742520be43
1 changed files with 8 additions and 0 deletions

View File

@ -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.