From 3702264294061a3ebd6d3547566012dbbbdd0e6a Mon Sep 17 00:00:00 2001 From: Jay Hutchinson Date: Tue, 12 Mar 2019 11:36:50 -0500 Subject: Added optional callback to FunctionCacheManager. --- pylru.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pylru.py b/pylru.py index b3c321a..c751e37 100644 --- a/pylru.py +++ b/pylru.py @@ -2,7 +2,7 @@ # Cache implementaion with a Least Recently Used (LRU) replacement policy and # a basic dictionary interface. -# Copyright (C) 2006-2018 Jay Hutchinson +# Copyright (C) 2006-2019 Jay Hutchinson # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free @@ -524,9 +524,9 @@ class WriteBackCacheManager(object): class FunctionCacheManager(object): - def __init__(self, func, size): + def __init__(self, func, size, callback=None): self.func = func - self.cache = lrucache(size) + self.cache = lrucache(size, callback) def size(self, size=None): return self.cache.size(size) -- cgit v1.2.1