[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

Forest list8a.forest at tibit.com
Tue Mar 3 20:20:37 CET 2009


I'm looking forward to an ordered dictionary in the standard library,
especially for things like LRU caches.  I was just reading the PEP, and
caught this bit:

"Does OrderedDict.popitem() return a particular key/value pair?
Yes. It pops-off the most recently inserted new key and its corresponding
value."

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.  Shouldn't popitem() allow the caller to choose which end from
which to pop?




More information about the Python-Dev mailing list