title: Python typings and futures
body: <p>I'm very glad to use <a href="https://docs.python.org/3/library/typing.html#module-typing" rel="noreferrer">typing</a> module in Python 3. Also, I'm very glad to use <a href="https://docs.python.org/3/library/asyncio.html" rel="noreferrer">asyncio</a> instead of <code>twisted</code>, <code>tornado</code> and alternatives.</p>
  
  <p>My question is how to define result of a coroutine properly?</p>
  
  <p>Should we tell it's just a coroutine? Example 1:</p>
  
  <pre><code>async def request() -&gt; asyncio.Future:
      pass
  </code></pre>
  
  <p>Or should we define type of result of coroutine as type of returning value? Example 2:</p>
  
  <pre><code>async def request() -&gt; int:
      pass
  </code></pre>
  
  <p>If yes, then how to be with plain functions, which return futures? Example 3:</p>
  
  <pre><code>def request() -&gt; asyncio.Future:
      f = asyncio.Future()
      # Do something with the future
      return f
  </code></pre>
  
  <p>Is it a right way? How then we can tell what is expected to be a result of the future?</p>