On Tue, 9 May 2000, Tom Cato Amundsen wrote:

> In my eartraining program, I have the (bad?) habit of using multiple
> inheritance:
> 
> class ChordBox(gkt.GtkHBox, DataStorage):
>       def __init__(self, name):
>               gtk.GtkHBox.__init__(self)
>               DataStorage.__init__(self, name)
>               ...
>               ...
> 
> With 0.7.0-unstable-dont-use, I get:
> 
>     DataStorage.__init__(self, name)
> TypeError: unbound method must be called with class instance 1st
> argument
> 
> Should I convert to having a DataStorage variable in ChordBox, or will
> this
> be possible 0.7.0 is finished?

This is due to the use of ExtensionClass.  I am not sure how to fix this
properly.  This is mentioned in the ExtensionClass.stx file included in
the tarball.  You can get your code to work with:
    DataStorage.__dict__['__init__'](self, name)

It doesn't look as pretty, but it does work.  The difference is that
DataStorage.__init__ is an unbound method that requires an Instance type
as its first argument (and in your case, self would be of type ChordBox),
while DataStorage.__dict__['__init__'] is just a plain function.

> 
> Tom Cato
> 

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


-
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to