From: Victor Stinner Date: Tue, 10 Jun 2014 09:16:05 +0000 (+0200) Subject: Issue #21596: asyncio.wait(): mention that the sequence of futures must not X-Git-Tag: v3.4.2rc1~409 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db74d982d43d98040e38665d843cbc8de4a082b1;p=python Issue #21596: asyncio.wait(): mention that the sequence of futures must not be empty. --- diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index eb254a9152..f1894daf31 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -521,6 +521,8 @@ Task functions to complete. Coroutines will be wrapped in Tasks. Returns two sets of :class:`Future`: (done, pending). + The sequence *futures* must not be empty. + *timeout* can be used to control the maximum number of seconds to wait before returning. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time. diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 2aa568bc6d..8b8fb82ed2 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -387,6 +387,8 @@ ALL_COMPLETED = concurrent.futures.ALL_COMPLETED def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED): """Wait for the Futures and coroutines given by fs to complete. + The sequence futures must not be empty. + Coroutines will be wrapped in Tasks. Returns two sets of Future: (done, pending).