except KeyError, everywhere

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Jun 6 23:45:36 EDT 2011


En Fri, 03 Jun 2011 21:02:56 -0300, Nobody <nobody at nowhere.com> escribió:

> On Fri, 03 Jun 2011 22:08:16 +0200, Wilbert Berendsen wrote:
>
>> I find myself all over the place associating objects with each other  
>> using
>> dicts as caches:
>
> The general concept is called "memoization". There isn't an  
> implementation
> in the standard library

Yes, there is, in Python 3.2:
http://docs.python.org/py3k/library/functools.html#functools.lru_cache


-- 
Gabriel Genellina




More information about the Python-list mailing list