except KeyError, everywhere
Ben Finney
ben+python at benfinney.id.au
Tue Jun 7 00:08:04 EDT 2011
"Gabriel Genellina" <gagsl-py2 at yahoo.com.ar> writes:
> 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
Beauty. Thanks!
--
\ “If we don't believe in freedom of expression for people we |
`\ despise, we don't believe in it at all.” —Noam Chomsky, |
_o__) 1992-11-25 |
Ben Finney
More information about the Python-list
mailing list