]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-93179: Document the thread safety of functools.lru_cache (GH-95970)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Thu, 18 Aug 2022 22:38:49 +0000 (17:38 -0500)
committerGitHub <noreply@github.com>
Thu, 18 Aug 2022 22:38:49 +0000 (17:38 -0500)
Doc/library/functools.rst

index 00aca09bc7af45323440521bfcfa0be05e4983a3..47cbe59fa49222930538afa6a7400e6cd2b91055 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.