23 Apr
2001
23 Apr
'01
7:31 p.m.
Peter Bengtsson writes:
... testing whether an object itself (not acquired) has an attribute .... No 'aq_explicit' doesn't work.
Make an external method: "hasattr_itself" with the following content: def hasattr_itself(object,attribute): '''return true iff *object* itself has attribute *attribute*.''' base= getattr(object,'aq_base',object) return hasattr(base,attribute) Put a feature request into the Collector. Zope should provide such a function as a built-in. Dieter