title: How to run a coroutine outside of an event loop?
body: <p>So typically, you grab the result of a coroutine by doing something like this:</p>
  
  <pre><code>async def coro():
      await asycnio.sleep(3)
      return 'a value'
  
  loop = asyncio.get_event_loop()
  value = loop.run_until_complete(coro())
  </code></pre>
  
  <p>Out of curiosity, what's the simplest way you can get that value without using an event loop?</p>
  
  <p>[EDIT]</p>
  
  <p>I think an even simpler way can be:</p>
  
  <pre><code>async def coro():
      ...
  
  value = asyncio.run(coro())  # Python 3.7+
  </code></pre>
  
  <p>But is there any way you can sort of <code>yield from</code> (or <code>await</code>) a <code>coro()</code> globally like in <a href="https://www.reddit.com/r/javascript/comments/6tuaxj/toplevel_await_is_supported_inside_latest_chrome/" rel="noreferrer">JS</a>? If not, why?</p>