summaryrefslogtreecommitdiffstats
path: root/Lib/functools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2012-03-31 09:19:06 (GMT)
committerRaymond Hettinger <python@rcn.com>2012-03-31 09:19:06 (GMT)
commitc6897854f8634e66fcb390d2301f57437bbdf774 (patch)
treeb4684930b983c7e5b2992086baa3ce75369ba2fa /Lib/functools.py
parent7f7a5a7b8743171d80b124edccfb7fe20bd86ac8 (diff)
downloadcpython-c6897854f8634e66fcb390d2301f57437bbdf774.zip
cpython-c6897854f8634e66fcb390d2301f57437bbdf774.tar.gz
cpython-c6897854f8634e66fcb390d2301f57437bbdf774.tar.bz2
Fix-up a comment
Diffstat (limited to 'Lib/functools.py')
-rw-r--r--Lib/functools.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/functools.py b/Lib/functools.py
index 6df75ed..ae4175d 100644
--- a/Lib/functools.py
+++ b/Lib/functools.py
@@ -172,7 +172,7 @@ def lru_cache(maxsize=100, typed=False):
cache = {}
hits = misses = 0
kwd_mark = (object(),) # separate positional and keyword args
- cache_get = cache.get # bound method to lookup key or return None
+ cache_get = cache.get # bound method to lookup a key or return None
sentinel = object() # unique object used with cache_get
_len = len # localize the global len() function
lock = Lock() # because linkedlist updates aren't threadsafe
@@ -250,8 +250,7 @@ def lru_cache(maxsize=100, typed=False):
# empty the oldest link and make it the new root
root = root[NEXT]
del cache[root[KEY]]
- root[KEY] = None
- root[RESULT] = None
+ root[KEY] = root[RESULT] = None
misses += 1
return result