File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,13 @@ The :mod:`functools` module defines the following functions:
49
49
>>> factorial(12) # makes two new recursive calls, the other 10 are cached
50
50
479001600
51
51
52
- The cache is threadsafe so the wrapped function can be used in multiple
53
- threads.
52
+ The cache is threadsafe so that the wrapped function can be used in
53
+ multiple threads. This means that the underlying data structure will
54
+ remain coherent during concurrent updates.
55
+
56
+ It is possible for the wrapped function to be called more than once if
57
+ another thread makes an additional call before the initial call has been
58
+ completed and cached.
54
59
55
60
.. versionadded :: 3.9
56
61
@@ -158,8 +163,13 @@ The :mod:`functools` module defines the following functions:
158
163
*maxsize * most recent calls. It can save time when an expensive or I/O bound
159
164
function is periodically called with the same arguments.
160
165
161
- The cache is threadsafe so the wrapped function can be used in multiple
162
- threads.
166
+ The cache is threadsafe so that the wrapped function can be used in
167
+ multiple threads. This means that the underlying data structure will
168
+ remain coherent during concurrent updates.
169
+
170
+ It is possible for the wrapped function to be called more than once if
171
+ another thread makes an additional call before the initial call has been
172
+ completed and cached.
163
173
164
174
Since a dictionary is used to cache results, the positional and keyword
165
175
arguments to the function must be :term: `hashable `.
You can’t perform that action at this time.
0 commit comments