title: How to compare two classes/types in python?
body: <p>I have two classes defined in a module <code>classes.py</code>:</p>
  
  <pre><code>class ClassA(object):
      pass
  
  class ClassB(object):
      pass
  </code></pre>
  
  <p>And in another module I am getting the attributes of the module:</p>
  
  <pre><code>import classes
  
  Class1 = getattr(classes, 'ClassA')
  Class2 = getattr(classes, 'ClassA')
  print type(Class1) == type(Class2)
  
  Class3 = getattr(classes, 'ClassA')
  Class4 = getattr(classes, 'ClassB')
  print type(Class3) == type(Class4)
  </code></pre>
  
  <p>Both type comparison are returning True and that's not what I was expecting.</p>
  
  <p>How can I compare class types using python's native type values?</p>