mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
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:
parent
b1e5d2c601
commit
1a713eac47
@ -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::
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user