Is there a way to ask a class what its metaclasses are ?
clp2 at rebertia.com
Sun Feb 22 15:11:59 EST 2009
On Sun, Feb 22, 2009 at 5:14 AM, Barak, Ron <Ron.Barak at lsi.com> wrote:
> Hi Chris,
> Is there a way to ask a class what its metaclasses are ?
> (e.g., how to ask wx.Frame what it's metaclass is)
Of course. A metaclass is the type of a class, so it's just type(wx.Frame).
Follow the path of the Iguana...
> I'm asking, because, even subclassing from object, viz.:
> class CopyAndPaste(object):
> def __init__(self):
> Still gives me:
> $ python -u ./failover_pickle_demo09.py
> Traceback (most recent call last):
> File "./failover_pickle_demo09.py", line 321, in <module>
> class ListControlMeta(wx.Frame, CopyAndPaste):
> TypeError: Error when calling the metaclass bases
> metaclass conflict: the metaclass of a derived class must be a
> (non-strict) subclass of the metaclasses of all its bases
More information about the Python-list