Is there a way to ask a class what its metaclasses are ?
Chris Rebert
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,
<snip
> 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).
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
>
> I'm asking, because, even subclassing from object, viz.:
>
> class CopyAndPaste(object):
> def __init__(self):
> pass
> ...
>
> 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
>
> Bye,
> Ron.
More information about the Python-list
mailing list