summaryrefslogtreecommitdiffstats
path: root/Doc/library/functools.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/functools.rst')
-rw-r--r--Doc/library/functools.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 82238fd..a8fc856 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -52,10 +52,16 @@ The :mod:`functools` module defines the following functions:
results, the positional and keyword arguments to the function must be
hashable.
- The wrapped function is instrumented with two attributes, :attr:`cache_hits`
- and :attr:`cache_misses` which count the number of successful or unsuccessful
- cache lookups. These statistics are helpful for tuning the *maxsize*
- parameter and for measuring the cache's effectiveness.
+ The wrapped function is instrumented with a :attr:`cache_info` attribute that
+ can be called to retrieve a named tuple with the following fields:
+
+ - :attr:`maxsize`: maximum cache size (as set by the *maxsize* parameter)
+ - :attr:`size`: current number of entries in the cache
+ - :attr:`hits`: number of successful cache lookups
+ - :attr:`misses`: number of unsuccessful cache lookups.
+
+ These statistics are helpful for tuning the *maxsize* parameter and for measuring
+ the effectiveness of the cache.
The wrapped function also has a :attr:`cache_clear` attribute which can be
called (with no arguments) to clear the cache.