mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Revert r84700 which had an unfortunate performance cost.
This commit is contained in:
parent
5e1fdacc36
commit
bd88802c1f
2 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue