Martin Panter added the comment:

Michel: I suspect your code doesn’t actually get up to handling any coroutines, 
and the problem is in your generator expression. What is “l”, and what are the 
items in it? The bug should already be fixed ready for the 3.5.2 and 3.6 
releases, but I can produce this on 3.5.0:

>>> l = [None]
>>> f = (coro() for coro in l) 
>>> asyncio.gather(*f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: gather() argument after * must be a sequence, not generator

In the current 3.6 code the bug is fixed:

>>> asyncio.gather(*f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <genexpr>
TypeError: 'NoneType' object is not callable

The reason why the second call does nothing interesting is because the 
generator expression has already die because of the exception, and there is 
nothing left to iterate:

>>> remaining = [*f]
>>> remaining
[]
>>> asyncio.gather(*remaining)
<Future finished result=[]>

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4806>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to