[Zope-CMF] isinstance on ActionProviderBase

Nicolas Romero Nicolas.Romero at adp3i.fr
Thu Oct 2 03:29:12 EDT 2003


Le mer 01/10/2003 à 21:24, Dieter Maurer a écrit :
> Nicolas Romero wrote at 2003-9-30 12:09 +0200:
>  > I am developping a product and I have a problem using isinstance on
>  > ActionProviderBase objects. Here is an excerpt of my code :
>  > ...
>  >        if isinstance( obj, ActionProviderBase):
>  > Let obj be a CMF tool...
> 
> Be aware, that Zope objects usually do *not* have the type you
> expect. Instead, they are usually acquisition wrappers.
> 
> Always use "aq_base(obj)" in "isinstance" checks...

Thank you for the tip, Dieter, but it does not work :-( 
I still have the wrong result (from my point of view) to the test  
isinstance(aq_base(obj),ActionProviderBase)

As acquisition machinery is far from being clear for me, I already
suspected it to be the origin of my problem. So I also tried to execute
obj=obj.aq_explicit before the test, without success.

> Dieter
-- 
Nicolas Romero, adp3i - 101, rue Bannier 45000 ORLEANS
                     |
Tél: 02 38 81 06 47  | adp3i <http://www.adp3i.fr>
Fax: 02 38 80 06 31  | Solutions Doméo <http://www.adp3i.net>




More information about the Zope-CMF mailing list