asyncio.run
是Python 3.7的新增功能。在3.5-3.6中,您的示例大致等效于:
import asyncio
futures = [...]
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait(futures))
Python3.6 AttributeError:模块“ asyncio”没有属性“运行”
asyncio.run
是Python 3.7的新增功能。在3.5-3.6中,您的示例大致等效于:
import asyncio
futures = [...]
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait(futures))