A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-March/086679.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 pronouncementTerry Reedy tjreedy at udel.edu
Tue Mar 3 23:33:27 CET 2009
Greg Ewing wrote:
> Giovanni Bajo wrote:
> 
>> Just today, I was talking with a colleague (which is learning Python 
>> right now) about "ordered dict". His first thought was a dictionary 
>> that, when iterated, would return keys in sorted order.
> 
> I wonder whether "indexed list" would be a more appropriate
> name for what we're talking about here -- basically
> a sequence type that holds things in arbitrary order, but
> with the additional ability to look things up quickly by
> a key.

I almost agree, except that the API uses the dict, not list, API.  For 
instance, items are appended by adding a key, not with .append.  With 
sort not available and .popitem removing the last added item, 'indexed 
stack' would be a bit closer.  Indeed, I plan to try out odicts with 
graph algorithms that need keyed access to stacked items.

tjr


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