]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-93179: Document the thread safety of functools.lru_cache (GH-95970)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 24 Dec 2022 20:25:34 +0000 (12:25 -0800)
committerGitHub <noreply@github.com>
Sat, 24 Dec 2022 20:25:34 +0000 (12:25 -0800)
(cherry picked from commit ba4bb7e4649be99d5d6b4151a1bd2eac89ef97f2)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Doc/library/functools.rst

index 9beebd2a85e5d91d2be0dda524bacad5a734bd43..2f0a9bd8be88155af4a1dae322728300bb917cd9 100644 (file)
@@ -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.