mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
GH-93179: Document the thread safety of functools.lru_cache (GH-95970)
This commit is contained in:
parent
214eb2cce5
commit
ba4bb7e464
1 changed files with 6 additions and 0 deletions
|
@ -49,6 +49,9 @@ The :mod:`functools` module defines the following functions:
|
|||
>>> factorial(12) # makes two new recursive calls, the other 10 are cached
|
||||
479001600
|
||||
|
||||
The cache is threadsafe so the wrapped function can be used in multiple
|
||||
threads.
|
||||
|
||||
.. versionadded:: 3.9
|
||||
|
||||
|
||||
|
@ -140,6 +143,9 @@ The :mod:`functools` module defines the following functions:
|
|||
*maxsize* most recent calls. It can save time when an expensive or I/O bound
|
||||
function is periodically called with the same arguments.
|
||||
|
||||
The cache is threadsafe so the wrapped function can be used in multiple
|
||||
threads.
|
||||
|
||||
Since a dictionary is used to cache results, the positional and keyword
|
||||
arguments to the function must be hashable.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue