Skip to content

dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order #76687

Closed

Description

@ericvsmith
BPO 32506
Nosy @ericvsmith
PRs
  • bpo-32506: Change dataclasses from OrderedDict to plain dict. #5130
  • bpo-32506: Change dataclasses from OrderedDict to plain dict. #5131
  • 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 = 'https://github.com/ericvsmith'
    closed_at = <Date 2018-03-21.09:24:43.437>
    created_at = <Date 2018-01-06.22:23:30.826>
    labels = ['3.7', 'type-bug', 'library']
    title = 'dataclasses: no need for OrderedDict now that dict guarantees to keep insertion order'
    updated_at = <Date 2018-03-21.09:24:43.436>
    user = 'https://github.com/ericvsmith'

    bugs.python.org fields:

    activity = <Date 2018-03-21.09:24:43.436>
    actor = 'eric.smith'
    assignee = 'eric.smith'
    closed = True
    closed_date = <Date 2018-03-21.09:24:43.437>
    closer = 'eric.smith'
    components = ['Library (Lib)']
    creation = <Date 2018-01-06.22:23:30.826>
    creator = 'eric.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32506
    keywords = ['patch']
    message_count = 2.0
    messages = ['309587', '309634']
    nosy_count = 1.0
    nosy_names = ['eric.smith']
    pr_nums = ['5130', '5131']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue32506'
    versions = ['Python 3.7']

    Activity

    1. ericvsmith commented on Jan 6, 2018

      @ericvsmith
      MemberAuthor

      There are several places where OrderedDict escapes from dataclasses. Switching to dict means we don't have to use OrderedDict forever.

      For the 3.6 backport, I'm also going to use dict. I saw an analysis (from Raymond, maybe?) that says there are no 3.6 implementations that don't guarantee insertion order for dict.

    2. self-assigned this
      on Jan 6, 2018
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Jan 7, 2018
    4. ericvsmith commented on Jan 7, 2018

      @ericvsmith
      MemberAuthor

      New changeset d138892 by Eric V. Smith in branch 'master':
      bpo-32506: Change dataclasses from OrderedDict to plain dict. (gh-5131)
      d138892

    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

    Labels

    3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions