Antoon Pardon wrote:

> I am experimenting with subclasses that all need the same metaclass as the
> base class. Is there a way to make the metaclass be inherited, so that you
> don't have to repeat the "metaclass = MetaClass" with every subclass.

?

This is not only possible, this is the default:

 >>> class Pardon(type): pass
... 
>>> class A(metaclass=Pardon): pass
... 
>>> class B(A): pass
... 
>>> type(B)
<class '__main__.Pardon'>



-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to