Author ncoghlan
Recipients georg.brandl, ncoghlan, rhettinger
Date 2010-11-30.04:55:32
SpamBayes Score 0.000304588
Marked as misclassified No
Message-id <1291092933.79.0.468038330909.issue10586@psf.upfronthosting.co.za>
In-reply-to
Content
Raymond suggested a simple cache_info() method that returns a named tuple as a possible alternative.

I like that idea, as it makes displaying debugging information (the intended use case for these attributes) absolutely trivial:

>>> import functools
>>> @functools.lru_cache()
... def f(x):
...   return x
... 
>>> f.cache_info()
lru_cache_info(maxsize=100, currsize=0, hits=0, misses=0)

(Alternative patch attached)
History
Date User Action Args
2010-11-30 04:55:34ncoghlansetrecipients: + ncoghlan, georg.brandl, rhettinger
2010-11-30 04:55:33ncoghlansetmessageid: <1291092933.79.0.468038330909.issue10586@psf.upfronthosting.co.za>
2010-11-30 04:55:32ncoghlanlinkissue10586 messages
2010-11-30 04:55:32ncoghlancreate