Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 010ce32

Browse files
committed
Minor change to default lru size. Set default to a power of two.
1 parent 3759877 commit 010ce32

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/functools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
4040
.. versionadded:: 3.2
4141

4242

43-
.. decorator:: lru_cache(maxsize=100, typed=False)
43+
.. decorator:: lru_cache(maxsize=128, typed=False)
4444

4545
Decorator to wrap a function with a memoizing callable that saves up to the
4646
*maxsize* most recent calls. It can save time when an expensive or I/O bound

Lib/functools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def __init__(self, args, kwds, typed,
166166
def __hash__(self):
167167
return self.hashvalue
168168

169-
def lru_cache(maxsize=100, typed=False):
169+
def lru_cache(maxsize=128, typed=False):
170170
"""Least-recently-used cache decorator.
171171
172172
If *maxsize* is set to None, the LRU features are disabled and the cache

0 commit comments

Comments
 (0)