[Python-checkins] Note that distinct argument patterns can be cached separately (GH-9298) (GH-9299)

Raymond Hettinger webhook-mailer at python.org
Fri Sep 14 04:13:23 EDT 2018


https://github.com/python/cpython/commit/a8f189f4571ca16e85d322cb45d1599526dbd9b4
commit: a8f189f4571ca16e85d322cb45d1599526dbd9b4
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Raymond Hettinger <rhettinger at users.noreply.github.com>
date: 2018-09-14T01:13:17-07:00
summary:

Note that distinct argument patterns can be cached separately (GH-9298) (GH-9299)

(cherry picked from commit 902bcd9a1e2c73c6de5510b771c590b618c4c94e)

Co-authored-by: Raymond Hettinger <rhettinger at users.noreply.github.com>

files:
M Doc/library/functools.rst

diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index a81e819103ad..3413cd353ca9 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -52,6 +52,11 @@ The :mod:`functools` module defines the following functions:
    Since a dictionary is used to cache results, the positional and keyword
    arguments to the function must be hashable.
 
+   Distinct argument patterns may be considered to be distinct calls with
+   separate cache entries.  For example, `f(a=1, b=2)` and `f(b=2, a=1)`
+   differ in their keyword argument order and may have two separate cache
+   entries.
+
    If *maxsize* is set to ``None``, the LRU feature is disabled and the cache can
    grow without bound.  The LRU feature performs best when *maxsize* is a
    power-of-two.



More information about the Python-checkins mailing list