semanticsc:\codepy - metaclass py making class in metaobj callspam (,{'data' 'meth''__module__''__main__'in metaobj newspam (,{'data' 'meth''__module__''__main__'in metaobj initspam (,{'data' 'meth''__module__''__main__'init class object['__module__''__doc__''data''__qualname__''meth'making instance data in factwe can use normal superclass inheritance to acquire the call interceptor in this coding model--the superclass here is serving essentially the same role as typeat least in terms of metaclass dispatchinstances inherit from classes and their supers normally class supermetaobjdef __call__(selfclassnamesupersclassdict)print('in supermetaobj call'classnamesupersclassdictsep='\ 'class self __new__(classnamesupersclassdictself __init__(classclassnamesupersclassdictreturn class class submetaobj(supermetaobj)def __new__(selfclassnamesupersclassdict)print('in submetaobj new'classnamesupersclassdictsep='\ 'return type(classnamesupersclassdictdef __init__(selfclassclassnamesupersclassdict)print('in submetaobj init:'classnamesupersclassdictsep='\ 'print(init class object:'list(class __dict__ keys())class spam(eggsmetaclass=submetaobj())rest of file unchanged invoke sub instance via super __call__ :\codepy - metaclass -super py making class in supermetaobj callas before in submetaobj newas before in submetaobj initas before coding metaclasses