On Tue, March 3, 2009 11:54 am, Guido van Rossum wrote:
> On Tue, Mar 3, 2009 at 11:20 AM, Forest <list8a.for...@tibit.com> wrote:
>> Okay, but I'd also like a convenient and fast way to find the oldest
>> entry
>> in an OrderedDict, which I think I'd need for an LRU cache.  Skimming
>> the
>> current patch (od7.diff), I didn't notice one.  Perhaps I simply missed
>> something.
>
> What's your use case?

An LRU cache which occasionally needs to scan the oldest keys in the
underlying odict to see if they should be purged.

> If you really need this you can do it easily by taking the first key
> returned by the iterator:

Yep.  I simply missed something.  That's what I get for reading patches
while hungry.  :)


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to