title: Confusion of annotating generator function as iterator
body: <p>In the python <a href="https://docs.python.org/3/library/typing.html" rel="noreferrer">typing</a> documentation it is written:</p>
  
  <blockquote>
    <p>Alternatively, annotate your generator as having a return type of either Iterable[YieldType] or Iterator[YieldType]:</p>
  </blockquote>
  
  <pre><code>def infinite_stream(start: int) -&gt; Iterator[int]:
      while True:
          yield start
          start += 1
  </code></pre>
  
  <p>I wrote a very easy example of printing an infinite stream. I have a generator function which is passed to another function and then called.</p>
  
  <pre><code>from typing import Iterator
  
  
  def infinite_stream(start: int) -&gt; Iterator[int]:
      while True:
          yield start
          start += 1
  
  
  def print_infinite_stream(inf_iterator: Iterator[int]):
      for x in inf_iterator(5):
          print(x)
  
  
  print_infinite_stream(infinite_stream)
  </code></pre>
  
  <p>With mypy i get two errors:</p>
  
  <ul>
  <li><p>error:Iterator[int] not callable</p></li>
  <li><p>error:Argument 1 to "print_infinite_stream" has incompatible type "Callable[[int], Iterator[int]]"; expected "Iterator[int]"</p></li>
  </ul>
  
  <p>I am confused why i am getting these errors as i worked according to the documentation and have the latest python (3.6.5) and mypy (0.590) installed. What is wrong here?   </p>