[Zope-dev] Re: hasattr implementation for Zope?

Dieter Maurer dieter at handshake.de
Sat May 28 04:56:35 EDT 2005


Tim Peters wrote at 2005-5-27 13:49 -0400:
> ...
>def lookup1(arg, _marker=object()):
>    return _marker
> ...
>_marker = object()
>def lookup3(arg):
>    return _marker
> ...
>lookup1  0.427597
>lookup3  0.404399

Do you understand why "lookup3" is faster than "lookup1"?

I had the "impression" that access to the function's local namespace
should be faster than any other variable access.

-- 
Dieter


More information about the Zope-Dev mailing list