summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2015-09-25 04:19:45 +0200
committerMichele Simionato <michele.simionato@gmail.com>2015-09-25 04:19:45 +0200
commitf1d2835e2745b19e8d984c0cb7defd527bd9e9e2 (patch)
tree7c4e3232a70b084d4b1e7d9b692ce16df3e3f5cd /src/tests
parent83aff01ac4a17fb104a3af4400160a083aab8ca2 (diff)
downloadpython-decorator-git-4.0.3.tar.gz
Added a docstring to the memoize example4.0.3
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/documentation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tests/documentation.py b/src/tests/documentation.py
index 766c4c6..8156e3c 100644
--- a/src/tests/documentation.py
+++ b/src/tests/documentation.py
@@ -1233,6 +1233,11 @@ def _memoize(func, *args, **kw):
def memoize(f):
+ """
+ A simple memoize implementation. It works by adding a .cache dictionary
+ to the decorated function. The cache will grow indefinitely, so it is
+ your responsability to clear it, if needed.
+ """
f.cache = {}
return decorate(f, _memoize)