A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-March/086663.html below:

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

[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncementRaymond Hettinger python at rcn.com
Tue Mar 3 21:02:14 CET 2009
[Forest]
> 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?

Forest, I've taken another look at what's involved and am inclined to recommend the idea.  It can be done without mucking-up the 
regular dict API and without precluding any of the other possible underlying algorithms.  I like that it supports an entire new 
categoy of use cases with only a trivial, easily-understood API extension.  Patch is attached at http://bugs.python.org/issue5397


Raymond 

More information about the Python-Dev mailing list

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