Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
010ce328
Commit
010ce328
authored
May 19, 2012
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor change to default lru size. Set default to a power of two.
parent
3759877f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
Doc/library/functools.rst
Doc/library/functools.rst
+1
-1
Lib/functools.py
Lib/functools.py
+1
-1
No files found.
Doc/library/functools.rst
View file @
010ce328
...
@@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
...
@@ -40,7 +40,7 @@ The :mod:`functools` module defines the following functions:
.. versionadded:: 3.2
.. versionadded:: 3.2
.. decorator:: lru_cache(maxsize=1
00
, typed=False)
.. decorator:: lru_cache(maxsize=1
28
, 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
...
...
Lib/functools.py
View file @
010ce328
...
@@ -166,7 +166,7 @@ class _CacheKey(list):
...
@@ -166,7 +166,7 @@ class _CacheKey(list):
def
__hash__
(
self
):
def
__hash__
(
self
):
return
self
.
hashvalue
return
self
.
hashvalue
def
lru_cache
(
maxsize
=
1
00
,
typed
=
False
):
def
lru_cache
(
maxsize
=
1
28
,
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment