]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-107619: Extend functools LRU cache docs with generators and async functions...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 20 Aug 2023 10:39:43 +0000 (03:39 -0700)
committerGitHub <noreply@github.com>
Sun, 20 Aug 2023 10:39:43 +0000 (10:39 +0000)
gh-107619: Extend functools LRU cache docs with generators and async functions (GH-107934)
(cherry picked from commit 1a713eac47b26899044752f02cbfcb4d628dda2a)

Co-authored-by: Hadházy Tamás <85063808+Hels15@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Doc/library/functools.rst

index 62fcddec090419d80e30734db1d1e8cd3144a9c7..9dadbb69fc2f24dd404bda287c9e134adf514e37 100644 (file)
@@ -211,8 +211,9 @@ The :mod:`functools` module defines the following functions:
 
    In general, the LRU cache should only be used when you want to reuse
    previously computed values.  Accordingly, it doesn't make sense to cache
-   functions with side-effects, functions that need to create distinct mutable
-   objects on each call, or impure functions such as time() or random().
+   functions with side-effects, functions that need to create
+   distinct mutable objects on each call (such as generators and async functions),
+   or impure functions such as time() or random().
 
    Example of an LRU cache for static web content::