From 5cd315b4fa9022683c07b79cf7bf2a25ae1817f6 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Thu, 5 Feb 2026 11:35:31 -0600 Subject: [PATCH] More realistic lru_cache example --- Doc/library/functools.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst index 221c0712c7c96a..b7c34bc64135ba 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.