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/2008-June/080444.html below:

[Python-Dev] Proposal: add odict to collections

[Python-Dev] Proposal: add odict to collectionsPhillip J. Eby pje at telecommunity.com
Sun Jun 15 16:29:05 CEST 2008
At 02:19 PM 6/15/2008 +0000, Antoine Pitrou wrote:
> > Ordered dicts, dicts that remember the chronological order of their
> > insertion, don't sound generally useful.
>
>They are generally useful in any case where you want to handle key-value
>pairs while not confusing a human operator by messing up the original order.
>Think e.g. configuration files. A common complaint against ConfigParser is
>that writing a configuration file does not preserve the order of the original
>file, which is harmless for the computer but very annoying for the human
>being who maintains that file.

You don't need an ordered dictionary for that; you need a save 
routine that stream-edits the old file contents.  That way, you don't 
lose comments and spacing either.

As for the other uses for ordered dictionaries, I find it simplest to 
just use a list of key,value pairs, and only transform it to a 
dictionary or dictionary-like structure as needed, using tools like 
the cgi module, the email package, or wsgiref.headers.

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