<div dir="ltr">I think this could be useful, but's answering the question of "what coroutine runner is this", not "what event loop is this". It's already possible to stack one event loop on top of another so that the question of event loop is ambiguous, but any `async def` function or other coroutine has exactly one coroutine runner. The identity of the coroutine runner matters more in practice than the event loop (PEP 484 has standardized the event loop interface but left coroutine runners unspecified). For more on this see <a href="https://github.com/tornadoweb/tornado/issues/1493">https://github.com/tornadoweb/tornado/issues/1493</a> (in which differences between coroutine runners became an issue in the context of the event loop integration between Tornado and asyncio), and <a href="https://github.com/tornadoweb/tornado/pull/1716">https://github.com/tornadoweb/tornado/pull/1716</a> (in which asyncio.sleep relies on certain behavior of the asyncio coroutine runner that prevents its use in the tornado coroutine runner). <div><br></div><div>-Ben</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 3, 2016 at 6:26 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Convincing everyone to agree on a single event loop API sounds hard.<br>
<br>
But maybe it would be useful to start with a baby step of defining a<br>
standard way for a coroutine to ask the event loop who it is, e.g.<br>
<br>
  await what_event_loop_is_this()<br>
    -> "asyncio"<br>
    -> "curio"<br>
    -> ...<br>
<br>
?<br>
<span class="HOEnZb"><font color="#888888"><br>
-n<br>
<br>
--<br>
Nathaniel J. Smith -- <a href="https://vorpus.org" rel="noreferrer" target="_blank">https://vorpus.org</a><br>
_______________________________________________<br>
Async-sig mailing list<br>
<a href="mailto:Async-sig@python.org">Async-sig@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/async-sig" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/async-sig</a><br>
Code of Conduct: <a href="https://www.python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">https://www.python.org/psf/codeofconduct/</a><br>
</font></span></blockquote></div><br></div>