Skip to content

Commit 5e21e9a

Browse files
committed
fix-issue-141831-update
1 parent 2ae0c37 commit 5e21e9a

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Doc/library/functools.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,8 @@ The :mod:`functools` module defines the following functions:
5757
another thread makes an additional call before the initial call has been
5858
completed and cached.
5959

60-
In particular, when the same key is computed concurrently in multiple
61-
threads, each thread may execute the wrapped function independently
62-
before the first result is stored in the cache. As a consequence, the
63-
return values from these concurrent calls may be distinct objects even
64-
though they correspond to the same cache key.
65-
66-
This behavior means that ``lru_cache`` should not be relied upon for
67-
singleton object creation or other scenarios requiring that only one
68-
instance be constructed for a given key without external synchronization.
60+
Call-once behavior is not guaranteed: no locks are held during the function
61+
call, so the same key may be computed multiple times concurrently.
6962

7063
.. versionadded:: 3.9
7164

0 commit comments

Comments
 (0)