15 Oct
2008
15 Oct
'08
4:10 p.m.
Jim Fulton <jim@zope.com> 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 · tl@gocept.com 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