diff options
| author | Manjusaka <me@manjusaka.me> | 2019-11-12 15:30:18 +0800 |
|---|---|---|
| committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-11-11 23:30:18 -0800 |
| commit | 051ff526b5dc2c40c4a53d87089740358822edfa (patch) | |
| tree | 3672f1a8ca53bfb008d3f56d2b8c5f29a04e3f6b /Doc/library | |
| parent | 98480cef9dba04794bd61c7e7cca643d384c8c35 (diff) | |
| download | cpython-git-051ff526b5dc2c40c4a53d87089740358822edfa.tar.gz | |
bpo-38565: add new cache_parameters method for lru_cache (GH-16916)
Diffstat (limited to 'Doc/library')
| -rw-r--r-- | Doc/library/functools.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index d3debac843..cedc3ad5ec 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -108,6 +108,11 @@ The :mod:`functools` module defines the following functions: cached separately. For example, ``f(3)`` and ``f(3.0)`` will be treated as distinct calls with distinct results. + The wrapped function is instrumented with a :func:`cache_parameters` + function that returns a new :class:`dict` showing the values for *maxsize* + and *typed*. This is for information purposes only. Mutating the values + has no effect. + To help measure the effectiveness of the cache and tune the *maxsize* parameter, the wrapped function is instrumented with a :func:`cache_info` function that returns a :term:`named tuple` showing *hits*, *misses*, @@ -178,6 +183,9 @@ The :mod:`functools` module defines the following functions: .. versionchanged:: 3.8 Added the *user_function* option. + .. versionadded:: 3.9 + Added the function :func:`cache_parameters` + .. decorator:: total_ordering Given a class defining one or more rich comparison ordering methods, this |
