[Zope-dev] Multiple inheritance woes

Rik Hoekstra hoekstra@fswrul.fsw.leidenuniv.nl
Fri, 10 Sep 1999 11:40:59 +0200


> -----Original Message-----
> From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf
> Of Martijn Pieters
> Sent: Friday, September 10, 1999 10:24 AM
> To: Phillip J. Eby; Zope-dev@zope.org
> Subject: Re: [Zope-dev] Multiple inheritance woes
>
>
> At 20:05 09/09/99 , Phillip J. Eby wrote:
> >At 02:54 PM 9/9/99 +0200, Martijn Pieters wrote:
> > >At 14:33 09/09/99 , Rik Hoekstra wrote:
> > >> >
> > >> > 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)
> > >> >
> > >> >
> > >>
> > >>A shot in the dark: Shouldn't this be
> > >>CatalogAware().index_object(self)? At least this explicitly
> > >>instanciates CatalogAware and stops raising TypeErrors. But I'm not
> > >>sure this completely solves your problem
> > >>
> > >>Rik
> > >
> > >Sorry, you missed =). In normal python this would work, but as Philip
> > >pointed out, when using Acquisition and ExtensionClasses, things are
> > >different, and throw the Python interpreter off.
> > >
> >
> >Actually, no, it wouldn't, because then you'd get a different TypeError,
> >this one for having passed too many arguments to the
> index_object() method.
> >  And besides, you don't want to call another object's index_object()
> >method, you want to call an overridden version of *your* index_object()
> >method.
>
> Heh, why does noone ever understand what I am saying =). I ment that _my_
> code would normally work in Python. I wasn't commenting on Rik's.
> There is
> a reasonable change I might meet him one day. After all, he's
> only about an
> hours drive away. =)
>

You bet :-\ (But I've learnt my lesson - I'll never post so quick again)

Rik