diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2015-02-12 22:49:18 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2015-02-12 22:49:18 +0100 |
| commit | bdd574d09a834f4b9935d91fe9d16a0d4a56d846 (patch) | |
| tree | fc8a317993cf8681d13318e8ea7443cd46abbba1 /Doc/library/asyncio-task.rst | |
| parent | 3d6c784371bccc2407048652bce50c5bccf9b1af (diff) | |
| download | cpython-git-bdd574d09a834f4b9935d91fe9d16a0d4a56d846.tar.gz | |
asyncio doc: annotate coroutine on coroutine functions and methods
Diffstat (limited to 'Doc/library/asyncio-task.rst')
| -rw-r--r-- | Doc/library/asyncio-task.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 3008c86709..edc05c3d6a 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -545,7 +545,7 @@ Task functions Return ``True`` if *func* is a decorated :ref:`coroutine function <coroutine>`. -.. function:: sleep(delay, result=None, \*, loop=None) +.. coroutinefunction:: sleep(delay, result=None, \*, loop=None) Create a :ref:`coroutine <coroutine>` that completes after a given time (in seconds). If *result* is provided, it is produced to the caller @@ -554,6 +554,8 @@ Task functions The resolution of the sleep depends on the :ref:`granularity of the event loop <asyncio-delayed-calls>`. + This function is a :ref:`coroutine <coroutine>`. + .. function:: shield(arg, \*, loop=None) Wait for a future, shielding it from cancellation. @@ -581,7 +583,7 @@ Task functions except CancelledError: res = None -.. function:: wait(futures, \*, loop=None, timeout=None, return_when=ALL_COMPLETED) +.. coroutinefunction:: wait(futures, \*, loop=None, timeout=None, return_when=ALL_COMPLETED) Wait for the Futures and coroutine objects given by the sequence *futures* to complete. Coroutines will be wrapped in Tasks. Returns two sets of @@ -626,7 +628,7 @@ Task functions when the timeout occurs are returned in the second set. -.. function:: wait_for(fut, timeout, \*, loop=None) +.. coroutinefunction:: wait_for(fut, timeout, \*, loop=None) Wait for the single :class:`Future` or :ref:`coroutine object <coroutine>` to complete with timeout. If *timeout* is ``None``, block until the future |
