I have two classes defined in a module classes.py
:
class ClassA(object):
pass
class ClassB(object):
pass
And in another m
In addition to the other answers :
Python uses the concept of metaclasses, which are basically "classes of classes". That means, even a Class is an object in Python, which has its own class - accessible using the type
in-build function.
Because ClassA
and ClassB
are by default instances of the same metaclass, the comparisons return True.
If you'd like to know more about metaclasses, this SO post is a good start.