27 May
2005
27 May
'05
7:53 a.m.
Dieter Maurer wrote:
I strongly argue against it. Fix "hasattr" in the Zope context, instead!
_marker = [] def hasattr(obj, attr, marker): a = getattr(obj, attr, _marker) return a is not _marker
import __builtin__ __builtin__.hasattr = hasattr
Easy enough, isn't it?
Way easier than to change "hasattr" anywhere it is now used.
Anyone think putting this in Zope core is a good idea? If so, where should it go? Any potential performance implications people can think of? cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk