Message260300
| Author |
Michel Desmoulin |
| Recipients |
DragonFireCK, Michel Desmoulin, Samuel BOVÉE, amaury.forgeotdarc, benjamin.peterson, brandjon, dangyogi, daniel.urban, georg.brandl, gpolo, hagen, kcarnold, martin.panter, ncoghlan, pfctdayelise, pitrou, python-dev, r.david.murray, ron_adam, terry.reedy, yselivanov |
| Date |
2016年02月15日.08:34:34 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1455525275.07.0.0887253878658.issue4806@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It gets even weirder with coroutines involved:
>>> f = (coro() for coro in l)
>>> asyncio.gather(*f) # TypeError: asyncio.gather() argument after * must be a sequence, not generator
>>> asyncio.gather(*[*f]) # ok
Because coroutines are executed later, the last gather() doesn't show the error message. So it tricked you into thinking that the second version is ok while the first one is not.
But of course, both are ok, the problem lies in a bug deeper in your coroutine triggering the TypeError. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年02月15日 08:34:35 | Michel Desmoulin | set | recipients:
+ Michel Desmoulin, georg.brandl, terry.reedy, amaury.forgeotdarc, ncoghlan, pitrou, ron_adam, dangyogi, benjamin.peterson, gpolo, hagen, kcarnold, r.david.murray, daniel.urban, python-dev, pfctdayelise, martin.panter, brandjon, yselivanov, DragonFireCK, Samuel BOVÉE |
| 2016年02月15日 08:34:35 | Michel Desmoulin | set | messageid: <1455525275.07.0.0887253878658.issue4806@psf.upfronthosting.co.za> |
| 2016年02月15日 08:34:35 | Michel Desmoulin | link | issue4806 messages |
| 2016年02月15日 08:34:34 | Michel Desmoulin | create |
|