diff options
| author | Raymond Hettinger <python@rcn.com> | 2012-03-16 11:48:12 -0700 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2012-03-16 11:48:12 -0700 |
| commit | d656958915de825f1c1f298fb8183555141e4956 (patch) | |
| tree | 2e176d1a8acb270e580d1b4e1550b1719dfd390d /Lib/functools.py | |
| parent | 01feaecbfa37ad85b8ae51c8c7743e1ce8d5a92f (diff) | |
| download | cpython-git-d656958915de825f1c1f298fb8183555141e4956.tar.gz | |
Minor code cleanup.
Diffstat (limited to 'Lib/functools.py')
| -rw-r--r-- | Lib/functools.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/functools.py b/Lib/functools.py index af24f423a2..4dd5913e0d 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: |
