title: Use await in python REPL directly
body: <p>I am wondering if there is a way to call <code>async</code> functions with <code>await</code> directly from python REPL ?</p>
  <p>So having following code as example:</p>
  <pre class="lang-py prettyprint-override"><code>import aiohttp
  import asyncio
  
  
  async def somefunc():
      async with aiohttp.ClientSession() as session:
          host_url = 'https://somehost'
          async with session.get(host_url) as resp:
              response = await resp.json()
          return response
  </code></pre>
  <p>What I am looking for is an easy way to debug similar functions, basically I'd like to</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; result = await somefunc()
  </code></pre>
  <p>I am aware that this can be done with</p>
  <pre class="lang-py prettyprint-override"><code>import asyncio
  
  loop = asyncio.get_event_loop()
  loop.run_until_complete(somefunc())
  </code></pre>
  <p>But using this approach I would need to either alter the body of somefunc to log the result of the response or use additional async function such as below to print the result</p>
  <pre class="lang-py prettyprint-override"><code>async def result_print():
      result = await somefunc()
      print(result)
  
  loop = asyncio.get_event_loop()
  loop.run_until_complete(result_print())
  </code></pre>
  <p>Summarising the things above, I am looking for a more convenient way to await async functions in the python REPL, maybe a custom REPL implementation that allows</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; result = await somefunc()
  </code></pre>
  <p>Or possible there's a way to do that in python default repl that I am not aware of ?</p>