From: Raymond Hettinger Date: Thu, 5 Feb 2026 18:04:12 +0000 (-0600) Subject: More realistic lru_cache example (gh-144517) X-Git-Tag: v3.15.0a6~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50e107f14996b55c60355fb901513e84cc2e589a;p=thirdparty%2FPython%2Fcpython.git More realistic lru_cache example (gh-144517) --- diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 221c0712c7c9..b7c34bc64135 100644 --- a/Doc/library/functools.rst +++ b/Doc/library/functools.rst @@ -180,8 +180,8 @@ The :mod:`functools` module defines the following functions: the *maxsize* at its default value of 128:: @lru_cache - def count_vowels(sentence): - return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou') + def count_vowels(word): + return sum(word.count(vowel) for vowel in 'AEIOUaeiou') If *maxsize* is set to ``None``, the LRU feature is disabled and the cache can grow without bound.