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?
********************************************************
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:
m=MySpecialGtkBox(...)
m.set_int('sound/volume', 100)
instead of single inheritance:
class MySpecialGtkBox(gtk.HBox):
def __init__(...):
self.cfg = ConfigUtils(...)
m=MySpecialGtkBox(...)
m.cfg.set_int('sound/volume', 100)
I have programmed object oriented for several years, but I have never
*needed* multiple inheritance for anything, except keystroke saving
thinks like described above. (But then, I only write incomplex code..)
---
Tom Cato Amundsen <[EMAIL PROTECTED]>
GNU Solfege - free eartraining, http://www.gnu.org/software/solfege/
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk