tasks = [asyncio.ensure_future(task(i)) for i in range(0,300)]
loop.run_until_complete(asyncio.gather(*tasks))
tasks = [task(i) for i in range(0,300)]
loop.run_until_complete(asyncio.wait(tasks))
Just look at the documentation and you will know that these two pieces of code have the same effect. However, the return values of wait and gather are different. Wait can also return when the first future is complete or an error occurs.
Just look at the documentation and you will know that these two pieces of code have the same effect. However, the return values of wait and gather are different. Wait can also return when the first future is complete or an error occurs.
RTFM......