9 Jul
2004
9 Jul
'04
5:50 p.m.
On Fri, 9 Jul 2004 16:22:17 +0200 Dieter Maurer <dieter@handshake.de> wrote: [..]
The "hasattr" replacement in Python's "__builtin__" could look like:
_marker = [] def hasattr(obj, attr): return getattr(obj, attr, _marker) is not _marker
Opinions?
+1 Another advantage to a global patch is that 3rd party products (such as CMF) would benefit automatically. I noticed yesterday some hasattr calls in DCWorkflow that could cause inaccurate results if the hasattr returned false due to a ConflictError. It might be worth profiling this and an alternate implementation in C to see if the latter is worthwhile. I can't imagine the C implementation would be all that complex. That would dispense with any performance disadvantage of the patch. -Casey