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, jrosdahl, pitrou, python-dev, yselivanov
Priority: normal Keywords: patch

Created on 2014-05-28 16:22 by Sebastian.Kreft.Deezer, last changed 2020-05-04 21:56 by gvanrossum. This issue is now closed.

Files
File name Uploaded Description Edit
wait_doc.patch vstinner, 2014-06-06 12:28 review
Pull Requests
URL Status Linked Edit
PR 19900 merged jrosdahl, 2020-05-04 12:24
Messages (6)
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.
msg368089 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-05-04 21:56
New changeset 9d74658f0a6e8a9b8d6dcf199dda886f35c6ad68 by Joel Rosdahl in branch 'master':
bpo-40499: Mention that asyncio.wait() needs a non-empty aws set (GH-19900)
https://github.com/python/cpython/commit/9d74658f0a6e8a9b8d6dcf199dda886f35c6ad68
History
Date User Action Args
2020-05-04 21:56:08gvanrossumsetmessages: + msg368089
2020-05-04 16:28:24vstinnersetnosy: - vstinner
2020-05-04 12:24:52jrosdahlsetnosy: + jrosdahl

pull_requests: + pull_request19212
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