[Python-ideas] Contiguous-array-based ordering for OrderedDict

Guido van Rossum guido at python.org
Sat Dec 12 19:27:01 EST 2015


I'm not following this thread all that closely, but am I the only one who
thinks that the LRU cache (discussed in another thread) could be
implemented with much less code on top of OrderedDict? Basically whenever
you access a key you just move it to the front, and when you add a key when
it is already at capacity you delete the first one.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20151212/cc07db5e/attachment.html>


More information about the Python-ideas mailing list