Skip to content

Commit a2393e8

Browse files
cliffordgamamiss-islington
authored andcommitted
Docs: Fix cached calls count in factorial example (gh-140882)
(cherry picked from commit 1ae9004) Co-authored-by: Clifford Gama <cliffygamy@gmail.com>
1 parent 2511fce commit a2393e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/functools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ The :mod:`functools` module defines the following functions:
4242
def factorial(n):
4343
return n * factorial(n-1) if n else 1
4444

45-
>>> factorial(10) # no previously cached result, makes 11 recursive calls
45+
>>> factorial(10) # no previously cached result, makes 11 recursive calls
4646
3628800
47-
>>> factorial(5) # just looks up cached value result
47+
>>> factorial(5) # no new calls, just returns the cached result
4848
120
49-
>>> factorial(12) # makes two new recursive calls, the other 10 are cached
49+
>>> factorial(12) # two new recursive calls, factorial(10) is cached
5050
479001600
5151

5252
The cache is threadsafe so that the wrapped function can be used in

0 commit comments

Comments
 (0)