[Python-checkins] r84047 - python/branches/py3k/Lib/functools.py

raymond.hettinger python-checkins at python.org
Sun Aug 15 00:29:52 CEST 2010


Author: raymond.hettinger
Date: Sun Aug 15 00:29:52 2010
New Revision: 84047

Log:
Localize one more builtin lookup.

Modified:
   python/branches/py3k/Lib/functools.py

Modified: python/branches/py3k/Lib/functools.py
==============================================================================
--- python/branches/py3k/Lib/functools.py	(original)
+++ python/branches/py3k/Lib/functools.py	Sun Aug 15 00:29:52 2010
@@ -119,7 +119,8 @@
     http://en.wikipedia.org/wiki/Cache_algorithms#Least-Frequently_Used
 
     """
-    def decorating_function(user_function, tuple=tuple, sorted=sorted, len=len):
+    def decorating_function(user_function, tuple=tuple, sorted=sorted,
+                            len=len, KeyError=KeyError):
         cache = {}                      # mapping of args to results
         use_count = Counter()           # times each key has been accessed
         kwd_mark = object()             # separate positional and keyword args
@@ -170,7 +171,8 @@
     http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
 
     """
-    def decorating_function(user_function, tuple=tuple, sorted=sorted, len=len):
+    def decorating_function(user_function, tuple=tuple, sorted=sorted,
+                            len=len, KeyError=KeyError):
         cache = OrderedDict()           # ordered least recent to most recent
         kwd_mark = object()             # separate positional and keyword args
         lock = Lock()


More information about the Python-checkins mailing list