Skip to content

Commit 4c042a3

Browse files
miss-islingtonHels15AA-Turnerkumaraditya303
authored
[3.11] gh-107619: Extend functools LRU cache docs with generators and async functions (GH-107934) (#108162)
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 5d366f2 commit 4c042a3

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
@@ -211,8 +211,9 @@ The :mod:`functools` module defines the following functions:
211211

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

217218
Example of an LRU cache for static web content::
218219

0 commit comments

Comments
 (0)