Solved: Metaclass conflict TypeError exception: problem demonstration script
Barak, Ron
Ron.Barak at lsi.com
Mon Feb 23 10:23:23 EST 2009
Hi,
> -----Original Message-----
> From: Tim Golden [mailto:mail at timgolden.me.uk]
> Sent: Monday, February 23, 2009 11:37
> Cc: python-list at python.org; wxpython-users at lists.wxwidgets.org
> Subject: Re: Metaclass conflict TypeError exception: problem
> demonstration script
>
> > $ cat -n metaclass_test01.py | head
> > 1 #!/usr/bin/env python
> > 2
> > 3 import sys
> > 4 import wx
> > 5 import CopyAndPaste
> > 6
> > 7 class ListControl(wx.Frame, CopyAndPaste):
> > 8 #class ListControl(wx.Frame):
> > 9 def __init__(self, parent, id, title, list,
> max_list_width):
> > 10
> wx.Frame.__init__(self,parent,id,title,size=(-1,-1),
> style=wx.DEFAULT_FRAME_STYLE)
> >
> > I get the metaclass conflict exception:
>
>
> You're trying to use a module as a base class.
> Don't do that; it doesn't work.
>
> TJG
>
>
That's it.
Once I changed my class header to:
$ cat -n metaclass_test01.py
1 #!/usr/bin/env python
2
3 import sys
4 import wx
5 import CopyAndPaste
6
7 class ListControl(wx.Frame, CopyAndPaste.CopyAndPaste):
I'm getting no more Metaclass conflict TypeError exceptions :-)
(a clear case of "The Devil Is In The ...")
Thanks so much,
Ron.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090223/293c6d6b/attachment.html>
More information about the Python-list
mailing list