What's the correct way to implement a metaclass with a different signature than `type`?
问题 Say I want to implement a metaclass that should serve as a class factory. But unlike the type constructor, which takes 3 arguments, my metaclass should be callable without any arguments: Cls1 = MyMeta() Cls2 = MyMeta() ... For this purpose I defined a custom __new__ method with no parameters: class MyMeta(type): def __new__(cls): return super().__new__(cls, 'MyCls', (), {}) But the problem is that python automatically calls the __init__ method with the same arguments as the __new__ method, so