On Sat, Apr 9, 2016 at 9:14 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > On Fri, Apr 8, 2016 at 5:54 PM, Alexander Myodov <amyo...@gmail.com> wrote: > This does mean that the pattern for calling aio_map from outside the > event loop is different from calling it inside the event loop. Your > main_loop coroutine becomes (note the addition of the "await"): > > async def main_loop(loop): > results = list(await aio_map(fetch_aio, range(5))) > assert(results == [{'aio_arg': '0'}, {'aio_arg': '1'}, {'aio_arg': > '2'}, {'aio_arg': '3'}, {'aio_arg': '4'}]), results > print('Assert ok!')
As a final afterthought, note that the result of asyncio.gather is already a list, so wrapping it in a list() call here is redundant. -- https://mail.python.org/mailman/listinfo/python-list