title: How can I await inside future-like object's __await__?
body: <p><a href="https://www.python.org/dev/peps/pep-0492/#await-expression" rel="noreferrer">PEP 0492</a> adds new <code>__await__</code> magic method. Object that implements this method becomes <em>future-like object</em> and can be awaited using <code>await</code>. It's clear:</p>
  
  <pre><code>import asyncio
  
  
  class Waiting:
      def __await__(self):
          yield from asyncio.sleep(2)
          print('ok')
  
  async def main():
      await Waiting()
  
  if __name__ == "__main__":
      loop = asyncio.get_event_loop()
      loop.run_until_complete(main())
  </code></pre>
  
  <p>Ok, but what if I want to call some <code>async def</code> defined function instead of <code>asyncio.sleep</code>? I can't use <code>await</code> because <code>__await__</code> is not <code>async</code> function, I can't use <code>yield from</code> because native coroutines requires <code>await</code> expression:</p>
  
  <pre><code>async def new_sleep():
      await asyncio.sleep(2)
  
  class Waiting:
      def __await__(self):
          yield from new_sleep()  # this is TypeError
          await new_sleep()  # this is SyntaxError
          print('ok')
  </code></pre>
  
  <p>How can I solve it?</p>