]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix-up a comment
authorRaymond Hettinger <python@rcn.com>
Sat, 31 Mar 2012 09:19:06 +0000 (02:19 -0700)
committerRaymond Hettinger <python@rcn.com>
Sat, 31 Mar 2012 09:19:06 +0000 (02:19 -0700)
Lib/functools.py

index 6df75ed0baae209eb57d102724fae6c38e9b6c41..ae4175d6a082713a89c0e565563a8ae1b37d0195 100644 (file)
@@ -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 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