Rule codename: do-not-import-asyncio Rule number: 666
You should not, because trio
# This is simple, do not import asyncio :)
import asyncio
If you use it for asyncio.sleep
, then you should access your transport. For instance, inside of a policy
class Mypolicy
async def on_request(self, request):
await request.context.transport.sleep(666)
If not sleep, or not a policy, at least import it locally and suppress the warning:
async def sommething():
import asyncio
asyncio.Lock()