classification
Title: asyncio.wait fails when futures list is empty
Type: Stage:
Components: asyncio, Documentation Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Sebastian.Kreft.Deezer, docs@python, giampaolo.rodola, gvanrossum, pitrou, python-dev, vstinner, yselivanov
Priority: normal Keywords: patch

Created on 2014-05-28 16:22 by Sebastian.Kreft.Deezer, last changed 2014-06-10 09:16 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
wait_doc.patch vstinner, 2014-06-06 12:28 review
Messages (5)
msg219290 - (view) Author: Sebastian Kreft (Sebastian.Kreft.Deezer) Date: 2014-05-28 16:22
Passing an empty list/set of futures to asyncio.wait raises an Exception, which is a little annoying in some use cases.

Probably this was the intended behavior as I see there's a test case for that. If such, then I would propose to document that behavior.
msg219877 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-06-06 12:28
> Probably this was the intended behavior as I see there's a test case for that. If such, then I would propose to document that behavior.

The code has an explicit check:

    if not fs:
        raise ValueError('Set of coroutines/Futures is empty.')

And yes, the behaviour is tested by test_asyncio.

Attached patch changes mention this behaviour in the documentation. Does it look correct?
msg219881 - (view) Author: Sebastian Kreft (Sebastian.Kreft.Deezer) Date: 2014-06-06 13:00
LGTM.
msg220155 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-06-10 09:16
New changeset 2b3f8b6d6e5c by Victor Stinner in branch '3.4':
Issue #21596: asyncio.wait(): mention that the sequence of futures must not
http://hg.python.org/cpython/rev/2b3f8b6d6e5c

New changeset 68d45a1a3ce0 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21596: asyncio.wait(): mention that the sequence of futures
http://hg.python.org/cpython/rev/68d45a1a3ce0
msg220156 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-06-10 09:16
Fixed. Thanks for the report.
History
Date User Action Args
2014-06-10 09:16:50vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg220156
2014-06-10 09:16:28python-devsetnosy: + python-dev
messages: + msg220155
2014-06-06 13:00:46Sebastian.Kreft.Deezersetmessages: + msg219881
2014-06-06 12:28:02vstinnersetfiles: + wait_doc.patch
keywords: + patch
messages: + msg219877
2014-06-06 11:43:34vstinnersetcomponents: + asyncio
2014-05-28 20:32:12vstinnersetnosy: + gvanrossum, pitrou, vstinner, giampaolo.rodola, yselivanov
2014-05-28 16:22:29Sebastian.Kreft.Deezercreate