Jim Fulton <[EMAIL PROTECTED]> wrote:

> I would change it to just use getattr rather than hasattr.
> 
> try:
>     getattr(ob, name)
> except AttributeError:
>     return False
> ...

This doesn't handle the case that the attribute exists as a property
but raises an AttributeError when trying to produce its value.

Thomas

-- 
Thomas Lotze · [EMAIL PROTECTED]
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to