ExtensionClass "TypeError: must be an instance" (was: Re: [Zope] ZGDCart problem)

Sylvain Thénault Sylvain.Thenault at logilab.fr
Thu Feb 12 16:34:53 EST 2004


On Thursday 12 February à 21:19, Dieter Maurer wrote:
> Sylvain Thénault wrote at 2004-2-11 23:49 +0100:
> > ...
> >I've encountered a similar problem which I could not understand for now:
> >I've a Zope product using a regular python package. The problem is that
> >the same kind of TypeError is raised _in the python package_, where no 
> >class knows anything about ExtensionClass (I mean there is no 
> >ExtensionClass.Base in the classes hierarchy) ! 
> 
> Does your product inherit from a class defined by this
> "regular python package"?
> 
> Then you have this same situation:
> 
>   "self" is an ExtensionClass instance.
> 
>   When your ExtensionClass unaware class "C" uses
>   "C'.method(self,...)" (where "C'" is an ExtensionClass unaware
>   base class of "C"), then you get the mentioned "TypeError".

Yes, I think I understand well that case. I've tried this approach in a
first draft of the product but finally abandoned it because it was to
messy. Now, the zope classes are totally separated from the classes of
the python package, there is no inheritance link between them. 
When I need to use the python package, I build a new model with the 
python package's classes by visiting zope classes instances to create
an equivalent model. And sometimes, I get this error in the python 
package while constructing the equivalent model... Gasp !

-- 
Sylvain Thénault                               LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org




More information about the Zope mailing list