[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement
Forest
list8a.forest at tibit.com
Tue Mar 3 21:07:38 CET 2009
On Tue, March 3, 2009 11:54 am, Guido van Rossum wrote:
> On Tue, Mar 3, 2009 at 11:20 AM, Forest <list8a.forest at 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. :)
More information about the Python-Dev
mailing list