mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Add method to OrderedDict for repositioning keys to the ends.
This commit is contained in:
parent
7b2a7710ef
commit
f45abc97bf
5 changed files with 51 additions and 8 deletions
|
@ -127,7 +127,7 @@ def lru_cache(maxsize=100):
|
|||
len=len, KeyError=KeyError):
|
||||
cache = OrderedDict() # ordered least recent to most recent
|
||||
cache_popitem = cache.popitem
|
||||
cache_renew = cache._renew
|
||||
cache_renew = cache.move_to_end
|
||||
kwd_mark = object() # separate positional and keyword args
|
||||
lock = Lock()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue