4 ms·
They differ slightly in semantics; asyncio.run() always creates a new event loop to run the task, while run_until_complete() don’t (unless you call asyncio.crea
by uranusjr 5y ago
They differ slightly in semantics; asyncio.run() always creates a new event loop to run the task, while run_until_complete() don’t (unless you call asyncio.create_event_loop() of course). I don’t know if this is the reason behind the decision, but the two are not equivalent (and there are cases asyncio.run() wouldn’t work).
- BiteCode_dev 5y agoYes but await doesn't, which is what I replaced run_until_complete() with here. The asyncio.run() is just to pretend I run the lib snippet in a code that already started the loop, which the doc seems to do.