[Python-checkins] cpython: Minor change to default lru size. Set default to a power of two.

raymond.hettinger python-checkins at python.org
Sun May 20 06:21:03 CEST 2012


http://hg.python.org/cpython/rev/1cd147d9c645
changeset:   77068:1cd147d9c645
user:        Raymond Hettinger <python at rcn.com>
date:        Sat May 19 21:20:48 2012 -0700
summary:
  Minor change to default lru size.  Set default to a power of two.

files:
  Doc/library/functools.rst |  2 +-
  Lib/functools.py          |  2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -40,7 +40,7 @@
    .. 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
diff --git a/Lib/functools.py b/Lib/functools.py
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -166,7 +166,7 @@
     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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list