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

csv.DictReader can return basic dict instead of OrderedDict #78184

Closed
selik mannequin opened this issue Jun 29, 2018 · 9 comments
Closed

csv.DictReader can return basic dict instead of OrderedDict #78184

selik mannequin opened this issue Jun 29, 2018 · 9 comments
Labels
3.8 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@selik
Copy link
Mannequin

selik mannequin commented Jun 29, 2018

BPO 34003
Nosy @rhettinger, @ericvsmith, @merwok, @selik, @miss-islington
PRs
  • bpo-34003: Use dict instead of OrderedDict in csv.DictReader #8014
  • bpo-34003: Re-add versionchanged entry in csv docs #20657
  • [3.9] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) #20770
  • [3.8] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) #20771
  • 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 2019-02-01.03:02:05.039>
    created_at = <Date 2018-06-29.19:47:39.124>
    labels = ['3.8', 'library', 'performance']
    title = 'csv.DictReader can return basic dict instead of OrderedDict'
    updated_at = <Date 2020-06-10.01:26:39.737>
    user = 'https://github.com/selik'

    bugs.python.org fields:

    activity = <Date 2020-06-10.01:26:39.737>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-01.03:02:05.039>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2018-06-29.19:47:39.124>
    creator = 'selik'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34003
    keywords = ['patch']
    message_count = 9.0
    messages = ['320734', '320735', '320739', '320741', '320748', '334613', '371148', '371151', '371152']
    nosy_count = 5.0
    nosy_names = ['rhettinger', 'eric.smith', 'eric.araujo', 'selik', 'miss-islington']
    pr_nums = ['8014', '20657', '20770', '20771']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue34003'
    versions = ['Python 3.8']

    @selik
    Copy link
    Mannequin Author

    selik mannequin commented Jun 29, 2018

    Since dicts are now keeping insertion order as of 3.7, we can switch to the more efficient construction of dict rather than OrderedDict for each row in the CSV file.

    @selik selik mannequin added the 3.8 only security fixes label Jun 29, 2018
    @selik
    Copy link
    Mannequin Author

    selik mannequin commented Jun 29, 2018

    Pull request.

    #8014

    @selik selik mannequin added stdlib Python modules in the Lib dir performance Performance or resource usage labels Jun 29, 2018
    @ericvsmith
    Copy link
    Member

    The dict and OrderedDict APIs are slightly different, although I'm not sure anyone cares. See bpo-32339. In that PR #4904, Guido said to not make this change. See also the python-dev discussion at https://mail.python.org/pipermail/python-dev/2017-December/151351.html

    If you feel strongly about this, I suggest discussing it on python-dev first.

    @selik
    Copy link
    Mannequin Author

    selik mannequin commented Jun 29, 2018

    I searched for previously submitted issues, but somehow didn't spot bpo-32339.

    I'll do some searching for whether anyone uses move_to_end on DictReader rows and respond to the mailing list with a report.

    @rhettinger
    Copy link
    Contributor

    This might need a deprecation before switching but it would be useful. The DictReader can produced huge numbers of instances that would benefit from the smaller size.

    @rhettinger
    Copy link
    Contributor

    New changeset 9f3f093 by Raymond Hettinger (Michael Selik) in branch 'master':
    bpo-34003: Use dict instead of OrderedDict in csv.DictReader (GH-8014)
    9f3f093

    @miss-islington
    Copy link
    Contributor

    New changeset 7aed052 by Éric Araujo in branch 'master':
    bpo-34003: Re-add versionchanged entry in csv docs (GH-20657)
    7aed052

    @miss-islington
    Copy link
    Contributor

    New changeset 663836e by Miss Islington (bot) in branch '3.8':
    [3.8] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) (GH-20771)
    663836e

    @miss-islington
    Copy link
    Contributor

    New changeset 73b728a by Miss Islington (bot) in branch '3.9':
    [3.9] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) (GH-20770)
    73b728a

    @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
    3.8 only security fixes performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants