I have been trying to understand python metaclasses, and so have been going through some sample code. As far as I understand it, a Python metaclass can be any callable. So, I can have my metaclass like
def metacls(clsName, bases, atts): .... return type(clsName, bases, atts)
However, I have seen a lot of people write their metaclasses in the following way:
class Metacls(type): def __new__(meta, clsName, bases, atts): .... return type.__new__(meta, clsName, bases, atts)
As far as I can see, these would both do the same thing. Is there any reason to use the base class instead? Is it customary?