asyncio, wrapping a normal function as asynchronous
问题 Is a function like: async def f(x): time.sleep(x) await f(5) properly asynchronous/non-blocking? Is the sleep function provided by asyncio any different? and finally, is aiorequests a viable asynchronous replacement for requests? (to my mind it basically wraps main components as asynchronous) https://github.com/pohmelie/aiorequests/blob/master/aiorequests.py 回答1: The provided function is not a correctly written async function because it invokes a blocking call, which is forbidden in asyncio.