This is similar to another question but in this case I would like to understand the type comparison between two class types that are the same but are dynamically created.
Consider an example from this SO question:
class SecretBaseClass(object):
pass
class Class(object):
pass
ClassType1 = type(Class.__name__, (SecretBaseClass,), dict(Class.__dict__))
ClassType2 = type(Class.__name__, (SecretBaseClass,), dict(Class.__dict__))
If I then do:
print ClassType1 == ClassType2
my result is false.
I get that I've created two distinct types, but to a human they are the same. At what level does the comparison operator recognise the difference?