Skip to content

Commit 50e107f

Browse files
authored
More realistic lru_cache example (gh-144517)
1 parent d9a2e58 commit 50e107f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/functools.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ The :mod:`functools` module defines the following functions:
180180
the *maxsize* at its default value of 128::
181181

182182
@lru_cache
183-
def count_vowels(sentence):
184-
return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou')
183+
def count_vowels(word):
184+
return sum(word.count(vowel) for vowel in 'AEIOUaeiou')
185185

186186
If *maxsize* is set to ``None``, the LRU feature is disabled and the cache can
187187
grow without bound.

0 commit comments

Comments
 (0)