From 4260736c5271169cc576f569abddc1701bd7c11d Mon Sep 17 00:00:00 2001 From: esadomer <54475303+esadomer@users.noreply.github.com> Date: Tue, 29 Sep 2026 17:35:27 +0300 Subject: [PATCH] Docs: Qualify the lru_cache scalar example with typed=True --- Doc/library/functools.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index debb7a7c3c2cc0..d8ec96feb30b93 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -185,11 +185,12 @@ The :mod:`!functools` module defines the following functions: types such as *str* and *int* may be cached separately even when *typed* is false.) - Note, type specificity applies only to the function's immediate arguments - rather than their contents. The scalar arguments, ``Decimal(42)`` and - ``Fraction(42)`` are treated as distinct calls with distinct results. - In contrast, the tuple arguments ``('answer', Decimal(42))`` and - ``('answer', Fraction(42))`` are treated as equivalent. + If *typed* is true, type specificity applies only to the function's + immediate arguments rather than their contents. The scalar arguments, + ``Decimal(42)`` and ``Fraction(42)`` are treated as distinct calls with + distinct results. In contrast, the tuple arguments + ``('answer', Decimal(42))`` and ``('answer', Fraction(42))`` are treated + as equivalent. The wrapped function is instrumented with a :func:`!cache_parameters` function that returns a new :class:`dict` showing the values for *maxsize*