8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec13b93 commit f0e0f20Copy full SHA for f0e0f20
Doc/library/functools.rst
@@ -118,6 +118,11 @@ The :mod:`functools` module defines the following functions:
118
The cache's size limit assures that the cache does not grow without bound on
119
long-running processes such as web servers.
120
121
+ In general, the LRU cache should only be used when you want to reuse
122
+ previously computed values. Accordingly, it doesn't make sense to cache
123
+ functions with side-effects, functions that need to create distinct mutable
124
+ objects on each call, or impure functions such as time() or random().
125
+
126
Example of an LRU cache for static web content::
127
128
@lru_cache(maxsize=32)
0 commit comments