title: How to pass subclass in function with base class typehint
body: <p>I have a base class <code>A</code> from what I inherit in sub class <code>B</code>.
  I have a function where an argument has this base class <code>A</code> as typehint.
  Now I want to pass to this function sub class <code>B</code>.
  This works, but I get a warning in my IDE "Expected type A, got B instead".</p>
  
  <p>How to do that correctly?</p>
  
  <pre><code>class A: pass
  
  class B(A): pass
  
  def test(a: A): pass
  
  test(B()) # &lt;- expected type A, got B instead
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I found the issue.
  I accidentally used the wrong base class as typehint in the <code>test(a: WRONG)</code>.</p>
  
  <p>The code above works!</p>
  
  <p>Thanks all for your answers!</p>