[Python-checkins] cpython: asyncio: document Task.current_task()
victor.stinner
python-checkins at python.org
Tue Dec 10 12:15:05 CET 2013
http://hg.python.org/cpython/rev/3f2d4bb34fd6
changeset: 87876:3f2d4bb34fd6
user: Victor Stinner <victor.stinner at gmail.com>
date: Tue Dec 10 12:14:50 2013 +0100
summary:
asyncio: document Task.current_task()
files:
Doc/library/asyncio-task.rst | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst
--- a/Doc/library/asyncio-task.rst
+++ b/Doc/library/asyncio-task.rst
@@ -273,6 +273,14 @@
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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list