]> granicus.if.org Git - python/commitdiff
Minor change to default lru size. Set default to a power of two.
authorRaymond Hettinger <python@rcn.com>
Sun, 20 May 2012 04:20:48 +0000 (21:20 -0700)
committerRaymond Hettinger <python@rcn.com>
Sun, 20 May 2012 04:20:48 +0000 (21:20 -0700)
Doc/library/functools.rst
Lib/functools.py

index 05f97b1bbdd1f2c19bd2f7d82c19344ac755c842..1b0d82a4bf3593606fbe4c89a5d58b0f44debabf 100644 (file)
@@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
    .. versionadded:: 3.2
 
 
-.. decorator:: lru_cache(maxsize=100, typed=False)
+.. decorator:: lru_cache(maxsize=128, typed=False)
 
    Decorator to wrap a function with a memoizing callable that saves up to the
    *maxsize* most recent calls.  It can save time when an expensive or I/O bound
index 8ef173296dac3d1c4d9d949815db56b99ad3e5be..9f024f14d7dec877ce79d3bda4ddd652c2b7755c 100644 (file)
@@ -166,7 +166,7 @@ class _CacheKey(list):
     def __hash__(self):
         return self.hashvalue
 
-def lru_cache(maxsize=100, typed=False):
+def lru_cache(maxsize=128, typed=False):
     """Least-recently-used cache decorator.
 
     If *maxsize* is set to None, the LRU features are disabled and the cache