[Zope-dev] Multiple inheritance woes

Phillip J. Eby pje@telecommunity.com
Thu, 09 Sep 1999 13:05:08 -0500


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.