title: python typing Dict and overloading: Overloaded function implementation does not accept all possible arguments
body: <pre class="lang-py prettyprint-override"><code>@overload
  def get_random(
          d:Dict[int,int]
  )-&gt;int:
      ...
  
  @overload
  def get_random(
          d:Dict[int,float]
  )-&gt;float:
      ...
  
  def get_random(
          d: Dict[int,Union[int,float]]
  )-&gt;Union[int,float]:
      key = random.choice(list(d.keys()))
      return d[key]
  
  
  a: int = get_random({1:1})
  b: float = get_random({1:1.})
  </code></pre>
  <p>mypy provides the following message:</p>
  <blockquote>
  <blockquote>
  <p>error: Overloaded function implementation does not accept all possible arguments of signature 1</p>
  </blockquote>
  </blockquote>
  <p>I am afraid I do not understand what the issue is.</p>
  <p>(note: I am aware that an alternative working solution is to use TypeVar)</p>