Skip to content

Commit 8c8f053

Browse files
committed
Add comment regarding thread-safety of weakref.WeakKeyDictionary.
1 parent c1a2df1 commit 8c8f053

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cachetools/_cachedmethod.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55

66
def _cachedmethod_condition(method, cache, key, lock, cond):
7+
# though not stated explicitly in the docs (yet), this *should* be
8+
# thread-safe even for free-threaded builds, especially since we
9+
# don't iterate over it; see
10+
# e.g. https://github.com/python/cpython/issues/89967
711
pending = weakref.WeakKeyDictionary()
812

913
def wrapper(self, *args, **kwargs):

0 commit comments

Comments
 (0)