[Python-Dev] new LRU cache API in Py3.2 (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Sat Sep 4 12:06:11 CEST 2010


On Sat, 04 Sep 2010 11:42:08 +0200 Éric Araujo <merwok at netwok.org> wrote:

> What about adding an intermediate namespace called "cache", so that the new > operations are available like this: > > print getphonenumber.cache.hits > getphonenumber.cache.clear() > > ? > > It's just a little more overhead, but I think it reads quite a bit better.

Or we could use pseudo-namespacing: getphonenumber.cachehits, getphonenumber.clearcache()

It looks better indeed.

Regards

Antoine.



More information about the Python-Dev mailing list