diff options
author | Raymond Hettinger <python@rcn.com> | 2010-09-04 22:46:06 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-09-04 22:46:06 (GMT) |
commit | 02566ec89f90e5696eef062414c69a7c7ee991df (patch) | |
tree | dc8ca5b5c0ca581ebdfaafd073d901c57e9137bd /Doc | |
parent | e9a4de51ab5ba19d4b1295aadad0533eea394b0a (diff) | |
download | cpython-02566ec89f90e5696eef062414c69a7c7ee991df.zip cpython-02566ec89f90e5696eef062414c69a7c7ee991df.tar.gz cpython-02566ec89f90e5696eef062414c69a7c7ee991df.tar.bz2 |
Adopt more descriptive attribute names as suggested on python-dev.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functools.rst | 6 | ||||
-rw-r--r-- | Doc/whatsnew/3.2.rst | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 00ab624..a6e2382 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -47,12 +47,12 @@ 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:`hits` - and :attr:`misses` which count the number of successful or unsuccessful + 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 also has a :attr:`clear` attribute which can be + The wrapped function also has a :attr:`cache_clear` attribute which can be called (with no arguments) to clear the cache. The original underlying function is accessible through the diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index e3cf864..9181b4f 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -85,17 +85,17 @@ New, Improved, and Deprecated Modules return c.fetchone()[0] To help with choosing an effective cache size, the wrapped function is - instrumented with two attributes *hits* and *misses*:: + instrumented with two attributes *cache_hits* and *cache_misses*:: >>> for name in user_requests: ... get_phone_number(name) - >>> print(get_phone_number.hits, get_phone_number.misses) + >>> print(get_phone_number.cache_hits, get_phone_number.cache_misses) 4805 980 If the phonelist table gets updated, the outdated contents of the cache can be cleared with:: - >>> get_phone_number.clear() + >>> get_phone_number.cache_clear() (Contributed by Raymond Hettinger) |