[Patches] [ python-Patches-1371075 ] ConfigParser to accept a custom dict to allow ordering

SourceForge.net noreply at sourceforge.net
Sun Dec 3 13:02:52 CET 2006


Patches item #1371075, was opened at 2005-12-01 18:39
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1371075&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.4
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Micah Elliott (mdelliot)
Assigned to: Nobody/Anonymous (nobody)
Summary: ConfigParser to accept a custom dict to allow ordering

Initial Comment:
In many cases it is preferrable for ConfigParser to
maintain the order
in which its items were added.  This small change adds
a `customdict`
default argument to *ConfigParser's constructor to
allow users to
specify a custom dict.

A useful example is::

    from ConfigParser import ConfigParser
    ConfigParser(customdict=my_ordered_dict)

One such `my_ordered_dict` could be the ordered
dictionary "odict"
<http://www.voidspace.org.uk/python/odict.html>.

Ordered dictionaries have been a recent popular topic on
comp.lang.python, and there are a few possibilities for
implementation, so it seems best that ConfigParser just
offer a
default argument to support such customization.

I can submit a documentation patch if this idea is
accepted.


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2006-12-03 13:02

Message:
Logged In: YES 
user_id=21627
Originator: NO

Thanks for the patch; I committed it with some modifications (e.g.
renaming of the parameter to dict_type). Committed as r52908.

Please include patches to the documentation and the test suite in the
future.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1371075&group_id=5470


More information about the Patches mailing list