Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParser to accept a custom dict to allow ordering #42649

Closed
mdelliot mannequin opened this issue Dec 1, 2005 · 2 comments
Closed

ConfigParser to accept a custom dict to allow ordering #42649

mdelliot mannequin opened this issue Dec 1, 2005 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@mdelliot
Copy link
Mannequin

mdelliot mannequin commented Dec 1, 2005

BPO 1371075
Nosy @loewis
Files
  • ConfigParser.diff: Unified diff of ConfigParser from Python lib 2.4.1
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2006-12-03.12:02:52.000>
    created_at = <Date 2005-12-01.17:39:53.000>
    labels = ['library']
    title = 'ConfigParser to accept a custom dict to allow ordering'
    updated_at = <Date 2006-12-03.12:02:52.000>
    user = 'https://bugs.python.org/mdelliot'

    bugs.python.org fields:

    activity = <Date 2006-12-03.12:02:52.000>
    actor = 'loewis'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2005-12-01.17:39:53.000>
    creator = 'mdelliot'
    dependencies = []
    files = ['6902']
    hgrepos = []
    issue_num = 1371075
    keywords = ['patch']
    message_count = 2.0
    messages = ['49158', '49159']
    nosy_count = 2.0
    nosy_names = ['loewis', 'mdelliot']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1371075'
    versions = ['Python 2.4']

    @mdelliot
    Copy link
    Mannequin Author

    mdelliot mannequin commented Dec 1, 2005

    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.

    @mdelliot mdelliot mannequin closed this as completed Dec 1, 2005
    @mdelliot mdelliot mannequin added the stdlib Python modules in the Lib dir label Dec 1, 2005
    @mdelliot mdelliot mannequin closed this as completed Dec 1, 2005
    @mdelliot mdelliot mannequin added the stdlib Python modules in the Lib dir label Dec 1, 2005
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Dec 3, 2006

    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.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants