Asyncio Python 编程代码实例, 同步函数的线程池实现异步, 迭代器异步, for 遍历异步 , 装饰器异步, 上下文管理器异步
importasyncioimporttimefromcontextlibimportcontextmanager,asynccontextmanagerasyncdeffun(n):print(f"{fun.__name__}{n}")awaitasyncio.sleep(2)print(f"{fun.__name__}{n}end")returnf"{fun.__name__}{n}"asyn