[Zope-dev] Multiple inheritance woes

Martijn Pieters mj@antraciet.nl
Thu, 09 Sep 1999 13:40:01 +0200


Hmm.. I know this is a python question, but DejaNews nor the Python website 
give me the answers I am looking for:

I define a baseclass derived from CatalogAware and DTMLMethod:

class Base(CatalogAware, DTMLMethod):
     def index_object(self):
         # check a few things I want to know about
         # before indexing, maybe even not allowing
         # the indexing
         CatalogAware.index_object(self)


Then I define a bunch of classes based on this base class:

class A(Base):
     pass

class B(Base):
     pass

etc.

Now, if I do the following:

a=A()
a.index_object()

I get a TypeError:
   unbound method must be called with class instance 1st argument

Now, I have seen all sorts of messages relating this error, but none of 
them seem to relate to my problem...

self in Vase.index_object _is_ a class instance, a step-by-step debug 
proves this. The python interpreter just won't accept it =(.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------