summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2011-04-26 09:42:28 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2011-04-26 09:42:28 +0200
commitddb1cca3c986cac3af2866bb9800b39f99bb262d (patch)
treed4149f19a5f29d1ae4a0303d6c1ab8c49392a379
parent9044fabeabf34e261ede5c0b918b39a8f65cbb2f (diff)
downloadlogilab-common-ddb1cca3c986cac3af2866bb9800b39f99bb262d.tar.gz
nicer docstring on clear_cache
-rw-r--r--decorators.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/decorators.py b/decorators.py
index 36ebe14..6b73440 100644
--- a/decorators.py
+++ b/decorators.py
@@ -117,7 +117,13 @@ def cached(callableobj=None, keyarg=None, **kwargs):
return decorator(callableobj)
def clear_cache(obj, funcname):
- """Function to clear a cache handled by the cached decorator."""
+ """Clear a cache handled by the :func:`cached` decorator. If 'x' class has
+ @cached on its method `foo`, type
+
+ >>> clear_cache(x, 'foo')
+
+ to purge this method's cache on the instance.
+ """
cls = obj.__class__
member = getattr(cls, funcname)
if isinstance(member, property):