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

This commit is contained in:
Raymond Hettinger 2018-09-14 00:53:20 -07:00 committed by GitHub
parent 5ac704306f
commit 902bcd9a1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,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.