[issue21596] asyncio.wait fails when futures list is empty
New submission from Sebastian Kreft:
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.
----------
assignee: docs@python
components: Documentation
messages: 219290
nosy: Sebastian.Kreft.Deezer, docs@python
priority: normal
severity: normal
status: open
title: asyncio.wait fails when futures list is empty
versions: Python 3.4
_______________________________________
Python tracker
Changes by STINNER Victor
Changes by STINNER Victor
STINNER Victor added the comment:
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?
----------
keywords: +patch
Added file: http://bugs.python.org/file35496/wait_doc.patch
_______________________________________
Python tracker
Sebastian Kreft added the comment:
LGTM.
----------
_______________________________________
Python tracker
Roundup Robot added the comment:
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
----------
nosy: +python-dev
_______________________________________
Python tracker
STINNER Victor added the comment:
Fixed. Thanks for the report.
----------
resolution: -> fixed
status: open -> closed
_______________________________________
Python tracker
Change by Joel Rosdahl
Change by STINNER Victor
Guido van Rossum
participants (5)
-
Guido van Rossum
-
Joel Rosdahl
-
Roundup Robot
-
Sebastian Kreft
-
STINNER Victor