class A(type): pass class B(A): pass class C(metaclass=A): pass print(type(C)) C.__class__ = B print(type(C))