Skip to content

Make the dict type used in csv.DictReader configurable #76520

Closed as not planned
Closed as not planned

Description

@serhiy-storchaka
BPO 32339
Nosy @rhettinger, @serhiy-storchaka, @aisk
PRs
  • bpo-32339: Make csv.DictReader returning regular dict instead of OrderedDict. #4904
  • 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 = None
    created_at = <Date 2017-12-15.19:00:53.576>
    labels = ['3.7', 'easy', 'type-feature', 'library']
    title = 'Make the dict type used in csv.DictReader configurable'
    updated_at = <Date 2021-12-17.11:07:10.801>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-12-17.11:07:10.801>
    actor = 'asaka'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2017-12-15.19:00:53.576>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32339
    keywords = ['patch', 'easy']
    message_count = 3.0
    messages = ['308420', '308434', '408771']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'serhiy.storchaka', 'asaka']
    pr_nums = ['4904']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32339'
    versions = ['Python 3.7']

    Activity

    1. serhiy-storchaka commented on Dec 15, 2017

      @serhiy-storchaka
      MemberAuthor

      Since 3.6 csv.DictReader emits OrderedDicts instead of regular dicts. Since regular dicts are ordered in 3.7, this is an overkill. It would be nice to add a configuration option for a return type.

      This is an easy issue.

    2. added
      3.7 (EOL)
      stdlib
      type-feature
      on Dec 15, 2017
    3. rhettinger commented on Dec 16, 2017

      @rhettinger
      Contributor

      For csv.DictReader and collections.namedtuple._asdict, it might be cleaner to just deprecate the OrderedDict in favor of returning regular dict. I suspect that in these contexts, no one really wants an actual OrderedDict.

    4. aisk commented on Dec 17, 2021

      aiskmannequin
      Mannequin

      As #4904 is closed now, I think this issue should be closed now?

    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

      3.7 (EOL)easystdlibtype-feature

      Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions