Message122881
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) |
|
Date |
User |
Action |
Args |
2010-11-30 04:55:34 | ncoghlan | set | recipients:
+ ncoghlan, georg.brandl, rhettinger |
2010-11-30 04:55:33 | ncoghlan | set | messageid: <1291092933.79.0.468038330909.issue10586@psf.upfronthosting.co.za> |
2010-11-30 04:55:32 | ncoghlan | link | issue10586 messages |
2010-11-30 04:55:32 | ncoghlan | create | |
|