刚学PYTHON的协程,我想请教下,这两段代码执行起来有什么区别呢?
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))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…