Skip to content

Commit f332594

Browse files
authored
gh-105172: Fixed functools.lru_cache typed argument docstring. (GH-105173)
1 parent a99b9d9 commit f332594

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/functools.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,9 @@ def lru_cache(maxsize=128, typed=False):
483483
can grow without bound.
484484
485485
If *typed* is True, arguments of different types will be cached separately.
486-
For example, f(3.0) and f(3) will be treated as distinct calls with
487-
distinct results.
486+
For example, f(decimal.Decimal("3.0")) and f(3.0) will be treated as
487+
distinct calls with distinct results. Some types such as str and int may
488+
be cached separately even when typed is false.
488489
489490
Arguments to the cached function must be hashable.
490491
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed :func:`functools.lru_cache` docstring accounting for ``typed``
2+
argument's different handling of str and int. Patch by Bar Harel.

0 commit comments

Comments
 (0)