How can make sure delete the least recent used item
kenshinx opened this issue · 2 comments
kenshinx commented
Hi
The __access_times
used in the follow is a unordered dictionary. How can make sure delete the least recently used item here?
while (len(self.__values) > self.max_size):
for k in self.__access_times.iterkeys():
self.__delete__(k)
break
Thanks
stucchio commented
Unless I missed a place where it is reassigned, I don't believe that is correct:
https://github.com/stucchio/Python-LRU-cache/blob/master/lru.py#L50
kenshinx commented
Sorry. I missed this line. I will close this issue.