[Zope] hasattr

Johan Carlsson johanc at easypublisher.com
Tue Sep 14 15:09:24 EDT 2004


Garito wrote:

> Hi all
> 
> I've created a Python Script like class with Catalogawarness and 
> PropertyManager as super classes too
> 
> My problems begins when I try to know if these objects has some 
> properties. If I try these:
> 
> hasattr(object.aq_explicit, 'someproperty')

Why do you try to get 'someproperty' from acquisition?

Don't you want to check for 'someproperty' in object?

Hence: hasattr(object, 'someproperty')


-- 
Johan Carlsson          Tel: + 46 8 31 24 94
Colliberty              Mob: + 46 70 558 25 24
Torsgatan 72            Email: johanc at easypublisher.com
SE-113 37 STOCKHOLM


More information about the Zope mailing list