Open jiffyclub opened 9 years ago
Yeah, it should definitely be possible to clear a cache. I think it is sufficient to expose func
, cache
, and key
as attributes of the memoized function.
Unlike lru_cache
, memoize
can accept a cache object from the user. Giving the user direct access to that is more flexible.
It would also be useful to do a "cache refresh", on a given call, ie.:
Function's decorated with functools' lru_cache have a
cache_clear()
function attached to them so that the cache can be manually invalidated. It'd be useful to me if toolz'smemoize
function did the same thing.