mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Minor change to default lru size. Set default to a power of two.
This commit is contained in:
parent
3759877f87
commit
010ce3283a
2 changed files with 2 additions and 2 deletions
|
@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
|
||||||
.. versionadded:: 3.2
|
.. 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
|
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
|
*maxsize* most recent calls. It can save time when an expensive or I/O bound
|
||||||
|
|
|
@ -166,7 +166,7 @@ class _CacheKey(list):
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return self.hashvalue
|
return self.hashvalue
|
||||||
|
|
||||||
def lru_cache(maxsize=100, typed=False):
|
def lru_cache(maxsize=128, typed=False):
|
||||||
"""Least-recently-used cache decorator.
|
"""Least-recently-used cache decorator.
|
||||||
|
|
||||||
If *maxsize* is set to None, the LRU features are disabled and the cache
|
If *maxsize* is set to None, the LRU features are disabled and the cache
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue