[Python-checkins] r86902 - python/branches/py3k/Doc/library/functools.rst
raymond.hettinger
python-checkins at python.org
Tue Nov 30 21:02:57 CET 2010
Author: raymond.hettinger
Date: Tue Nov 30 21:02:57 2010
New Revision: 86902
Log:
Documentation nits.
Modified:
python/branches/py3k/Doc/library/functools.rst
Modified: python/branches/py3k/Doc/library/functools.rst
==============================================================================
--- python/branches/py3k/Doc/library/functools.rst (original)
+++ python/branches/py3k/Doc/library/functools.rst Tue Nov 30 21:02:57 2010
@@ -63,16 +63,16 @@
:attr:`__wrapped__` attribute. This is useful for introspection, for
bypassing the cache, or for rewrapping the function with a different cache.
- A `LRU (least recently used) cache
+ An `LRU (least recently used) cache
<http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used>`_ works
best when more recent calls are the best predictors of upcoming calls (for
example, the most popular articles on a news server tend to change daily).
The cache's size limit assures that the cache does not grow without bound on
long-running processes such as web servers.
- Example -- Caching static web content::
+ Example of an LRU cache for static web content::
- @functools.lru_cache(maxsize=20)
+ @lru_cache(maxsize=20)
def get_pep(num):
'Retrieve text of a Python Enhancement Proposal'
resource = 'http://www.python.org/dev/peps/pep-%04d/' % num
More information about the Python-checkins
mailing list