class Meta(type):
def store(self):
print("Meta store")
class Handler(metaclass=Meta):
pass
For example, we have 2 above classes.
As you know, Meta
inherit type
for metaclass.
handler = Handler # without initialize
handler.store()
In this case, we can access Meta
's store()
method without initializing class. (handler = Handler)
How can it happen in metaclass?
Is there any documentation detailing the inner workings of metaclasses?
Thanks.