3.4.1. 可等待对象

awaitable 对象主要实现了 await() 方法。 从 async def 函数返回的 Coroutine 对象即属于可等待对象。

注解

从带有 types.coroutine()asyncio.coroutine() 装饰器的生成器返回的 generator iterator 对象也属于可等待对象,但它们并未实现 await()

3.5 新版功能.

参见

PEP 492 了解有关可等待对象的详细信息。