On Mon, 1 Oct 2001, Tom Cato Amundsen wrote:
> I still have the habit of using multiple inheritance. I'm using
> your latest pygtk-1.99-2.
>
> The following code fails for both class A and B:
> #!/home/tom/PY22/bin/python2.2
>
> import sys
> sys.path.insert(0, "/home/tom/gtk2/lib/python2.2/site-packages")
> import gobject, gtk
>
> class MY:
> pass
> class A(gobject.GBoxed, MY):
> pass
> class B(gtk.SpinButton, MY):
> pass
>
> I get this exception:
>
> Traceback (most recent call last):
> File "./test.py", line 9, in ?
> class A(gobject.GBoxed, MY):
> TypeError: metatype conflict among bases
>
> I have not even tried to figure out what's wrong, but I guess this
> should work in pygtk-2.0-final?
The above will work with the following modification:
class MY(object):
pass
guess 2.2 doesn't like mixing old style and new style classes. This is a
python issue rather than a pygtk issue.
>
> ********************************************************
> WARNING: off-topic question ahead. Sorry for the spam...
>
> OT question from a music teacher:
> Is it bad practise to use multiple inhertitance just to save a few
> key strokes, having
>
> class MySpecialGtkBox(gtk.HBox, ConfigUtils):
> ...
>
> where ConfigUtils provides functions like set_int, get_int etc, that
> let me write code like:
Nothing wrong with using mixins.
James.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk