Berry Schoenmakers <l.a.m.schoenmak...@tue.nl> added the comment:
The current implementation of asyncio.run() is focused quite a bit on one-shot use. After the call returns, the default event loop is even gone: calling asyncio.get_event_loop() gives "RuntimeError: There is no current event loop in thread 'MainThread'." It would be nice if asyncio.run() uses the default loop if it's available (and not running), and that the default loop remains intact after the call returns. This way multiple calls to asyncio.run() that all use the default loop are supported, maybe using an asyncio.Queue (or whatever) across these calls---attaching everything to the same (default) loop. I find this very useful, for instance when writing unit tests. ---------- nosy: +lschoe _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38599> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com