Skip to content

Commit ba4bb7e

Browse files
authored
GH-93179: Document the thread safety of functools.lru_cache (GH-95970)
1 parent 214eb2c commit ba4bb7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/functools.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ The :mod:`functools` module defines the following functions:
4949
>>> factorial(12) # makes two new recursive calls, the other 10 are cached
5050
479001600
5151

52+
The cache is threadsafe so the wrapped function can be used in multiple
53+
threads.
54+
5255
.. versionadded:: 3.9
5356

5457

@@ -140,6 +143,9 @@ The :mod:`functools` module defines the following functions:
140143
*maxsize* most recent calls. It can save time when an expensive or I/O bound
141144
function is periodically called with the same arguments.
142145

146+
The cache is threadsafe so the wrapped function can be used in multiple
147+
threads.
148+
143149
Since a dictionary is used to cache results, the positional and keyword
144150
arguments to the function must be hashable.
145151

0 commit comments

Comments
 (0)