This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aeros
Recipients Ben.Darnell, aeros, asvetlov, serhiy.storchaka, xtreak, yselivanov
Date 2021-05-31.18:16:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622484988.28.0.313159746734.issue39529@roundup.psfhosted.org>
In-reply-to
Content
> But why does `asyncio.run` unconditionally create a new event loop instead of running on `asyncio.get_event_loop`? 

AFAIK, it does so for purposes of compatibility in programs that need multiple separate event loops and providing a degree of self-dependency. asyncio.run() is entirely self-reliant in that it creates all needed resources at the start and closes them in finalization, rather than depending on existing resources. I believe this to be significantly safer and better guaranteed to function as intended, although perhaps at some cost to convenience in cases like your own where there only needs to be one event loop.
History
Date User Action Args
2021-05-31 18:16:28aerossetrecipients: + aeros, asvetlov, Ben.Darnell, serhiy.storchaka, yselivanov, xtreak
2021-05-31 18:16:28aerossetmessageid: <1622484988.28.0.313159746734.issue39529@roundup.psfhosted.org>
2021-05-31 18:16:28aeroslinkissue39529 messages
2021-05-31 18:16:28aeroscreate