Skip to content

ConfigParser to accept a custom dict to allow ordering #42649

Closed

Description

@mdelliot
mannequin
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']

    Activity

    1. mdelliot commented on Dec 1, 2005

      mdelliotmannequin
      MannequinAuthor

      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.

    2. added
      stdlib
      on Dec 1, 2005
    3. added
      stdlib
      on Dec 1, 2005
    4. loewis commented on Dec 3, 2006

      loewismannequin
      Mannequin

      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.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlib

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions