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

Dieter Maurer dieter at handshake.de
Thu Feb 12 15:19:36 EST 2004


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".

The easiest solution is to make the base class ExtensionClass aware
(i.e. inherit from "ExtensionClass.Base"). But, this requires
modification of your regular package.

As an alternative: you must override the problematic method
and use the technique either described in this thread or
that in the "ExtensionClass" documentation.

-- 
Dieter



More information about the Zope mailing list