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. :)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4