Skip to content

Commit fbe1cff

Browse files
miss-islingtonHels15AA-Turnerkumaraditya303
authored
[3.12] gh-107619: Extend functools LRU cache docs with generators and async functions (GH-107934) (#108161)
gh-107619: Extend functools LRU cache docs with generators and async functions (GH-107934) (cherry picked from commit 1a713ea) Co-authored-by: Hadházy Tamás <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Kumar Aditya <[email protected]>
1 parent 1e46f1a commit fbe1cff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/library/functools.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,9 @@ The :mod:`functools` module defines the following functions:
226226

227227
In general, the LRU cache should only be used when you want to reuse
228228
previously computed values. Accordingly, it doesn't make sense to cache
229-
functions with side-effects, functions that need to create distinct mutable
230-
objects on each call, or impure functions such as time() or random().
229+
functions with side-effects, functions that need to create
230+
distinct mutable objects on each call (such as generators and async functions),
231+
or impure functions such as time() or random().
231232

232233
Example of an LRU cache for static web content::
233234

0 commit comments

Comments
 (0)