[issue5397] PEP 372: OrderedDict

Forest Wilkinson report at bugs.python.org
Tue Mar 3 20:24:00 CET 2009


Forest Wilkinson <forest at users.sourceforge.net> added the comment:

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
key, which I think I'd need for an LRU cache.  I didn't notice one in
the patch.  Perhaps I simply missed something.  Shouldn't popitem()
allow the caller to choose which end from which to pop?

----------
nosy: +forest

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5397>
_______________________________________


More information about the Python-bugs-list mailing list