gh-107619: Extend functools LRU cache docs with generators and async functions (#107934)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
Hadházy Tamás 2023-08-20 11:33:15 +01:00 committed by GitHub
parent b1e5d2c601
commit 1a713eac47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,8 +226,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::