summaryrefslogtreecommitdiff
path: root/psutil/_common.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2016-08-05 22:51:58 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2016-08-05 22:51:58 +0200
commitfec353c2736ad18d2d6d98e5b41e6517e43fa07c (patch)
tree2209a88ec1967ec07cf475ae3427a895c70788a1 /psutil/_common.py
parent8f27cbb4c98e6398f93488c9c223e4c0cc2cb64d (diff)
downloadpsutil-fec353c2736ad18d2d6d98e5b41e6517e43fa07c.tar.gz
update memoize_when_activated docstring
Diffstat (limited to 'psutil/_common.py')
-rw-r--r--psutil/_common.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/psutil/_common.py b/psutil/_common.py
index 58297e9b..e89d3968 100644
--- a/psutil/_common.py
+++ b/psutil/_common.py
@@ -264,11 +264,15 @@ def memoize(fun):
def memoize_when_activated(fun):
"""A memoize decorator which is disabled by default. It can be
activated and deactivated on request.
+ For efficiency reasons it can be used only against class methods
+ accepting no arguments.
- >>> @memoize
- ... def foo()
- ... print(1)
+ >>> class Foo:
+ ... @memoize
+ ... def foo()
+ ... print(1)
...
+ >>> f = Foo()
>>> # deactivated (default)
>>> foo()
1