title: How can I check if a type is a subtype of a type in Python?
body: <p>How can I check if a type is a subtype of a type in Python?  I am not referring to instances of a type, but comparing type instances themselves.  For example:</p>
  
  <pre><code>class A(object):
      ...
  
  class B(A):
      ...
  
  class C(object)
      ...
  
  # Check that instance is a subclass instance:
  isinstance(A(), A) --&gt; True
  isinstance(B(), A) --&gt; True
  isinstance(C(), A) --&gt; False
  
  # What about comparing the types directly?
  SOME_FUNCTION(A, A) --&gt; True
  SOME_FUNCTION(B, A) --&gt; True
  SOME_FUNCTION(C, A) --&gt; False
  </code></pre>