On Fri, 9 Jul 2004 16:22:17 +0200
Dieter Maurer <[EMAIL PROTECTED]> 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?


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.


Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to