summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlhutch <jlhutch@gmail.com>2015-03-17 12:13:35 -0500
committerjlhutch <jlhutch@gmail.com>2015-03-17 12:13:35 -0500
commit5e24a4b4d141ff7b6426d771ada3801665132e5c (patch)
tree1432257d45f402258283397a5e7d521d27cc6d46
parent221dd259f5c34562c835611d1cf62384b9019da4 (diff)
parent35eda410d422066cc470901d5bea231f66fcd855 (diff)
downloadpylru-5e24a4b4d141ff7b6426d771ada3801665132e5c.tar.gz
Merge pull request #12 from iho/patch-1
Make cache available from outer space.
-rw-r--r--README.txt2
-rw-r--r--pylru.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/README.txt b/README.txt
index 7f77865..48a655c 100644
--- a/README.txt
+++ b/README.txt
@@ -209,5 +209,7 @@ PyLRU also provides a function decorator::
return x*x
# Now results of the square function are cached for future lookup.
+ # You can get full access to cache via square.cache .
+
diff --git a/pylru.py b/pylru.py
index 28d55d5..a6fce0f 100644
--- a/pylru.py
+++ b/pylru.py
@@ -529,4 +529,5 @@ class lrudecorator(object):
value = func(*args, **kwargs)
self.cache[key] = value
return value
+ wrapped.cache = self.cache
return wrapped