Revert r84700 which had an unfortunate performance cost.

This commit is contained in:
Raymond Hettinger 2010-09-11 08:07:42 +00:00
parent 5e1fdacc36
commit bd88802c1f
2 changed files with 8 additions and 8 deletions

View file

@ -123,8 +123,8 @@ def lru_cache(maxsize=100):
http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used
"""
def decorating_function(user_function,
*, tuple=tuple, sorted=sorted, len=len, KeyError=KeyError):
def decorating_function(user_function, tuple=tuple, sorted=sorted,
len=len, KeyError=KeyError):
cache = OrderedDict() # ordered least recent to most recent
cache_popitem = cache.popitem
cache_renew = cache.move_to_end