[Python-Dev] Speeding up name lookups

M.-A. Lemburg mal@lemburg.com
Wed, 21 Nov 2001 16:01:04 +0100


Oren Tirosh wrote:
> 
> [Define name type for lookup purposes]

Just as note: Guido once proposed to cache (almost) all results
of global lookups in the frame object. This causes some
incompatibilities for e.g. global symbols that change their
value after the first lookup.

I'm not sure whether your approach goes in the same direction, 
but I think that we might be better off using some form of descriptor
for this than using a new type.

The descriptor could basically work much like what you propose,
i.e. cache the container object where the symbol was found and 
maybe even its last value provided that the container and the
found object meet some criteria of constantness.

I'd suggest to write this up as a PEP.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Consulting & Company:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/