Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6c12091

Browse filesBrowse files
miss-islingtonrhettinger
authored andcommitted
bpo-35300: Add usage note to the lru_cache() docs (GH-10707) (GH-10709)
1 parent 8c1592e commit 6c12091
Copy full SHA for 6c12091

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed

‎Doc/library/functools.rst

Copy file name to clipboardExpand all lines: Doc/library/functools.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ The :mod:`functools` module defines the following functions:
8080
The cache's size limit assures that the cache does not grow without bound on
8181
long-running processes such as web servers.
8282

83+
In general, the LRU cache should only be used when you want to reuse
84+
previously computed values. Accordingly, it doesn't make sense to cache
85+
functions with side-effects, functions that need to create distinct mutable
86+
objects on each call, or impure functions such as time() or random().
87+
8388
Example of an LRU cache for static web content::
8489

8590
@lru_cache(maxsize=32)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.