I am implementing a cached method with cachetools like this:
class CachedNum(object):
def __init__(self, cachesize):
self.cache = LRUCache(maxsize=cachesize)
@cachedmethod(lambda self: self.cache)
def get(self, num):
return num + 1000
nums = CachedNum(cachesize=10)
nums.get.cache_info() # This is missing
nums.cache.cache_info() # The cache itself also has no statistics
In contrast there are no cache statistics about hits/misses. Is this an oversight in cachetools or do I need to track them myself?
No, it's not an oversight, there just wasn't agreement on how self should be used with cache_info(), and there hasn't been sufficient demand for this, at least to my knowledge.
PRs are welcome, of course.
I am implementing a cached method with cachetools like this:
In contrast there are no cache statistics about hits/misses. Is this an oversight in cachetools or do I need to track them myself?