Yury Selivanov added the comment: > Honestly I think it's pretty crazy and out there to have multiple event loops in the same thread. That feels like an anti-pattern inspired by some other event loop APIs (in other languages) that encourage this. But asyncio was not designed for that.
I agree. OTOH, if you're designing a library for asyncio, you want it to be as foolproof as possible, so many people simply pass an event loop everywhere. It's especially annoying when you have a huge chunk of code that didn't need the loop, and then when something needs it you have to refactor everything or use "get_event_loop". In terms of performance, I don't think this is gonna affect anything, it's just a couple of additional thread-local sets in the Loop.run method. And we can design "get_running_loop" to raise a clear exception if no loop is currently running. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26969> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com