summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-16 23:22:53 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-03-16 23:22:53 (GMT)
commit29a837d8575d581c99e8626a3eda8c0e10888cac (patch)
treee5105094aee02098c520b1526a45f0bb27b26c3e
parent954cf578c760e2b9e0fe9b3eedcfd3d1bfc7f7ec (diff)
parentd656958915de825f1c1f298fb8183555141e4956 (diff)
downloadcpython-29a837d8575d581c99e8626a3eda8c0e10888cac.zip
cpython-29a837d8575d581c99e8626a3eda8c0e10888cac.tar.gz
cpython-29a837d8575d581c99e8626a3eda8c0e10888cac.tar.bz2
merge heads
-rw-r--r--Lib/functools.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/functools.py b/Lib/functools.py
index 3455d7c..7fc42af 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -156,6 +156,7 @@ def lru_cache(maxsize=100, typed=False):
lock = Lock() # needed because linkedlist isn't threadsafe
root = [] # root of circular doubly linked list
root[:] = [root, root, None, None] # initialize by pointing to self
+ PREV, NEXT, KEY, RESULT = 0, 1, 2, 3 # names of link fields
if maxsize is None:
@wraps(user_function)
@@ -191,8 +192,6 @@ def lru_cache(maxsize=100, typed=False):
key += tuple(map(type, args))
if kwds:
key += tuple(type(v) for k, v in sorted_items)
- PREV = 0 # names of link fields
- NEXT = 1
with lock:
link = cache_get(key)
if link is not None: