From: Raymond Hettinger Date: Mon, 4 Mar 2013 08:54:45 +0000 (-0500) Subject: merge X-Git-Tag: v3.4.0a1~1283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=32e2ff5dc5f0c78c943e958c52feb0424ae94a1b;p=python merge --- 32e2ff5dc5f0c78c943e958c52feb0424ae94a1b diff --cc Lib/functools.py index a019268d4f,87c1b6992e..02bff42bd3 --- a/Lib/functools.py +++ b/Lib/functools.py @@@ -303,8 -283,9 +307,8 @@@ def lru_cache(maxsize=128, typed=False) # put result in a new link at the front of the queue last = root[PREV] link = [last, root, key, result] - cache[key] = last[NEXT] = root[PREV] = link + last[NEXT] = root[PREV] = cache[key] = link - currsize += 1 - full = (currsize == maxsize) + full = (len(cache) == maxsize) misses += 1 return result