aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykyta Holubakha <hilobakho@gmail.com>2017-06-30 03:47:13 +0300
committerMykyta Holubakha <hilobakho@gmail.com>2017-06-30 03:47:13 +0300
commite34c5f770cc3bc48db7a4d62583e6ac738a48575 (patch)
treef3c5c6f8509cb0350c889b0398c09e112c24571e /pomu/util/cache.py
parentAdded README (diff)
downloadpomu-e34c5f770cc3bc48db7a4d62583e6ac738a48575.tar.gz
pomu-e34c5f770cc3bc48db7a4d62583e6ac738a48575.tar.bz2
pomu-e34c5f770cc3bc48db7a4d62583e6ac738a48575.zip
Fix unit tests
Diffstat (limited to 'pomu/util/cache.py')
-rw-r--r--pomu/util/cache.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pomu/util/cache.py b/pomu/util/cache.py
index 3419a4b..1c92a4e 100644
--- a/pomu/util/cache.py
+++ b/pomu/util/cache.py
@@ -8,7 +8,12 @@ class cached():
def __init__(self, fun):
self.fun = fun
self.__name__ = fun.__name__
+
def __call__(self, *args):
if not hasattr(self, 'retval'):
self.retval = self.fun(*args).unwrap()
return self.retval
+
+ def _drop(self):
+ if hasattr(self, 'retval'):
+ del self.retval