mirror of
https://github.com/python/cpython
synced 2026-09-27 03:48:16 +03:00
gh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)
This commit is contained in:
parent
a99b9d911e
commit
f332594dd4
2 changed files with 5 additions and 2 deletions
|
|
@ -483,8 +483,9 @@ def lru_cache(maxsize=128, typed=False):
|
|||
can grow without bound.
|
||||
|
||||
If *typed* is True, arguments of different types will be cached separately.
|
||||
For example, f(3.0) and f(3) will be treated as distinct calls with
|
||||
distinct results.
|
||||
For example, f(decimal.Decimal("3.0")) and f(3.0) will be treated as
|
||||
distinct calls with distinct results. Some types such as str and int may
|
||||
be cached separately even when typed is false.
|
||||
|
||||
Arguments to the cached function must be hashable.
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
Fixed :func:`functools.lru_cache` docstring accounting for ``typed``
|
||||
argument's different handling of str and int. Patch by Bar Harel.
|
||||
Loading…
Add table
Add a link
Reference in a new issue