<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3492" name=GENERATOR></HEAD>
<BODY><!-- Converted from text/plain format -->
<P dir=ltr style="MARGIN-RIGHT: 0px"><FONT size=2><FONT
face=Arial>Hi,<BR><BR>> -----Original Message-----<BR>> From: Tim Golden
[</FONT><A href="mailto:mail@timgolden.me.uk"><FONT
face=Arial>mailto:mail@timgolden.me.uk</FONT></A><FONT face=Arial>]<BR>>
Sent: Monday, February 23, 2009 11:37<BR>> Cc: python-list@python.org;
wxpython-users@lists.wxwidgets.org<BR>> Subject: Re: Metaclass conflict
TypeError exception: problem<BR>> demonstration script<BR>><BR>> > $
cat -n metaclass_test01.py | head<BR>> >
1 #!/usr/bin/env python<BR>> >
2<BR>> > 3 import sys<BR>>
> 4 import wx<BR>>
> 5 import CopyAndPaste<BR>>
> 6<BR>> >
7 class ListControl(wx.Frame, CopyAndPaste):<BR>>
> 8 #class ListControl(wx.Frame):<BR>>
> 9 def
__init__(self, parent, id, title, list,<BR>> max_list_width):<BR>>
>
10 <BR>>
wx.Frame.__init__(self,parent,id,title,size=(-1,-1),<BR>>
style=wx.DEFAULT_FRAME_STYLE)<BR>> ><BR>> > I get the metaclass
conflict exception:<BR>><BR>><BR>> You're trying to use a module as a
base class.<BR>> Don't do that; it doesn't work.<BR>><BR>>
TJG<BR>><BR>><BR><BR>That's it.<BR><BR>Once I changed my class header
to:</FONT></FONT></P><FONT face=Arial>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P dir=ltr style="MARGIN-RIGHT: 0px"><FONT face=Courier size=2>$ cat -n
metaclass_test01.py<BR> 1 #!/usr/bin/env
python<BR> 2<BR> 3
import sys<BR> 4 import
wx<BR> 5 import
CopyAndPaste<BR> 6<BR> 7
class ListControl(wx.Frame, <FONT
color=#0000ff>CopyAndPaste.</FONT>CopyAndPaste):</FONT></P></BLOCKQUOTE><FONT
face=Courier></FONT>
<P dir=ltr style="MARGIN-RIGHT: 0px"><BR><FONT size=2>I'm getting no more
<EM>Metaclass conflict TypeError</EM> exceptions :-)<BR></FONT><FONT
size=2>(a clear case of "The Devil Is In The ...")</FONT></P>
<P dir=ltr style="MARGIN-RIGHT: 0px"><FONT size=2>Thanks so
much,<BR>Ron.</FONT></FONT><FONT face=Arial> </FONT></P></BODY></HTML>