https://github.com/python/cpython/commit/50e107f14996b55c60355fb901513e84cc2e589a
commit: 50e107f14996b55c60355fb901513e84cc2e589a
branch: main
author: Raymond Hettinger <[email protected]>
committer: rhettinger <[email protected]>
date: 2026-02-05T12:04:12-06:00
summary:

More realistic lru_cache example (gh-144517)

files:
M Doc/library/functools.rst

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.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to