Metaclasses in Python
A metaclass is the class of a class. While a class defines how an instance of the class behaves, a metaclass defines how a class behaves. A metaclass is most commonly used as a class factory. As we create an instance of the class by calling the class, python creates a new class by calling the meta-class. By defining __init__() and __new__() methods in the metaclass, you can do a lot of extra things (while creating a class) like registering the new class with some registry or replacing the class completely.
