summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2013-04-07 03:28:05 (GMT)
committerRaymond Hettinger <python@rcn.com>2013-04-07 03:28:05 (GMT)
commit1a2ea9c592feae00452f16e9507be37c8bcb8cea (patch)
tree01414c59c8140d904bf13575818695829afa72ab /Doc
parentcdbb06c15cadc818f22ee54901138545874452a6 (diff)
parent17328e4fae5007d5657b6233d7c548b2fc84a310 (diff)
downloadcpython-1a2ea9c592feae00452f16e9507be37c8bcb8cea.zip
cpython-1a2ea9c592feae00452f16e9507be37c8bcb8cea.tar.gz
cpython-1a2ea9c592feae00452f16e9507be37c8bcb8cea.tar.bz2
merge
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functools.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index f5c6608..d8fcf0f 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -79,7 +79,7 @@ The :mod:`functools` module defines the following functions:
Example of an LRU cache for static web content::
- @lru_cache(maxsize=20)
+ @lru_cache(maxsize=32)
def get_pep(num):
'Retrieve text of a Python Enhancement Proposal'
resource = 'http://www.python.org/dev/peps/pep-%04d/' % num
@@ -93,8 +93,8 @@ The :mod:`functools` module defines the following functions:
... pep = get_pep(n)
... print(n, len(pep))
- >>> print(get_pep.cache_info())
- CacheInfo(hits=3, misses=8, maxsize=20, currsize=8)
+ >>> get_pep.cache_info()
+ CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)
Example of efficiently computing
`Fibonacci numbers <http://en.wikipedia.org/wiki/Fibonacci_number>`_
@@ -108,10 +108,10 @@ The :mod:`functools` module defines the following functions:
return n
return fib(n-1) + fib(n-2)
- >>> print([fib(n) for n in range(16)])
+ >>> [fib(n) for n in range(16)]
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]
- >>> print(fib.cache_info())
+ >>> fib.cache_info()
CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)
.. versionadded:: 3.2