For your reference only
github.com/python/cpython/issues/7...
Changed in (Python) version 3.11: Passing coroutine objects to wait() directly is forbidden. (被禁用)
asyncio.wait() accepts coroutines, wraps them into Tasks, and later returns those implicitly created Tasks in (done, pending) sets. This is very confusing to new asyncio users and it's almost impossible to figure out what is going on.
asyncio.wait() 接受協程,將它們包裝到任務中,然後在 (done, pending) 集合中返回那些隱式創建的任務。這對於新的 asyncio 用戶來說非常混亂,並且幾乎不可能弄清楚發生了什麼。
For your reference only
github.com/python/cpython/issues/7...
Changed in (Python) version 3.11: Passing coroutine objects to wait() directly is forbidden. (被禁用)
asyncio.wait() accepts coroutines, wraps them into Tasks, and later returns those implicitly created Tasks in (done, pending) sets. This is very confusing to new asyncio users and it's almost impossible to figure out what is going on.
asyncio.wait() 接受協程,將它們包裝到任務中,然後在 (done, pending) 集合中返回那些隱式創建的任務。這對於新的 asyncio 用戶來說非常混亂,並且幾乎不可能弄清楚發生了什麼。
推荐文章: