title: mypy Incompatible default for argument
body: <p>Given the following example</p>
  <pre><code>from typing import Any, Iterable, Callable, TypeVar, Tuple
  
  from itertools import islice
  
  
  T = TypeVar('T')
  
  def take1(n:int, iterable:Iterable[T]) -&gt; Tuple[T,...]:  
      return tuple(islice(iterable, n))
      
  
  def take2(n:int, iterable:Iterable[Any], container:Callable[[Iterable[Any]],T]=tuple) -&gt; T:  
      return container(islice(iterable, n))
      
  </code></pre>
  <p>as is I get</p>
  <pre><code>test.py:12: error: Incompatible default for argument &quot;container&quot; (default has type &quot;Type[Tuple[Any, ...]]&quot;, argument has type &quot;Callable[[Iterable[Any]], T]&quot;)
  Found 1 error in 1 file (checked 1 source file)
  </code></pre>
  <p>As you can see <em>take2</em> is a more generalize version of <em>take1</em>, that by default is <em>take1</em> but if the user want to put the result into something else there isn't some throw away tuple in the middle by just providing the desired container directly. So for instance <code>&quot;&quot;.join(take1(3,&quot;abcdefg&quot;))</code> is equivalent to <code>take2(3,&quot;abcdefg&quot;,&quot;&quot;.join)</code> just that there isn't that throw away tuple that <em>take1</em> would make, which can be relevant in for example <code>sum(take1(10**10,itertools.count())</code> vs <code>take2(10**10,itertools.count(),sum)</code> (take1 will fail with a memory error here while take2 will succeed eventually)...</p>
  <p>For that I think the hint I put there is perfectly adequate, but mypy doesn't like it.</p>
  <p><strong>So, how can I type hint take2 so it pass the mypy test?</strong> (beside <code>#type: ignore</code> I suppose) and still get an useful info when calling help on it</p>