[Python-checkins] gh-107619: Extend functools LRU cache docs with generators and async functions (#107934)
kumaraditya303
webhook-mailer at python.org
Sun Aug 20 06:33:18 EDT 2023
https://github.com/python/cpython/commit/1a713eac47b26899044752f02cbfcb4d628dda2a
commit: 1a713eac47b26899044752f02cbfcb4d628dda2a
branch: main
author: Hadházy Tamás <85063808+Hels15 at users.noreply.github.com>
committer: kumaraditya303 <kumaraditya at python.org>
date: 2023-08-20T10:33:15Z
summary:
gh-107619: Extend functools LRU cache docs with generators and async functions (#107934)
Co-authored-by: Adam Turner <9087854+AA-Turner at users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya at python.org>
files:
M Doc/library/functools.rst
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 40f43f8b3519c..f736eb0aca1ac 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -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::
More information about the Python-checkins
mailing list