This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: csv.DictReader can return basic dict instead of OrderedDict
Type: performance Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, eric.smith, miss-islington, rhettinger, selik
Priority: normal Keywords: patch

Created on 2018-06-29 19:47 by selik, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8014 merged selik, 2018-06-29 19:59
PR 20657 merged eric.araujo, 2020-06-05 19:08
PR 20770 merged miss-islington, 2020-06-10 01:02
PR 20771 merged miss-islington, 2020-06-10 01:02
Messages (9)
msg320734 - (view) Author: Michael Selik (selik) * Date: 2018-06-29 19:47
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.
msg320735 - (view) Author: Michael Selik (selik) * Date: 2018-06-29 19:59
Pull request.

https://github.com/python/cpython/pull/8014
msg320739 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2018-06-29 20:55
The dict and OrderedDict APIs are slightly different, although I'm not sure anyone cares. See #32339. In that PR https://github.com/python/cpython/pull/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.
msg320741 - (view) Author: Michael Selik (selik) * Date: 2018-06-29 21:13
I searched for previously submitted issues, but somehow didn't spot #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.
msg320748 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2018-06-30 00:50
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.
msg334613 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-01-31 08:47
New changeset 9f3f0931cfc58498086d287226650599a97412bb by Raymond Hettinger (Michael Selik) in branch 'master':
bpo-34003: Use dict instead of OrderedDict in csv.DictReader (GH-8014)
https://github.com/python/cpython/commit/9f3f0931cfc58498086d287226650599a97412bb
msg371148 - (view) Author: miss-islington (miss-islington) Date: 2020-06-10 01:02
New changeset 7aed0524d4129766a6032326949ef7f91f6f6dfc by Éric Araujo in branch 'master':
bpo-34003: Re-add versionchanged entry in csv docs (GH-20657)
https://github.com/python/cpython/commit/7aed0524d4129766a6032326949ef7f91f6f6dfc
msg371151 - (view) Author: miss-islington (miss-islington) Date: 2020-06-10 01:26
New changeset 663836e1179ea79eac12e55670af7e89a531a060 by Miss Islington (bot) in branch '3.8':
[3.8] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) (GH-20771)
https://github.com/python/cpython/commit/663836e1179ea79eac12e55670af7e89a531a060
msg371152 - (view) Author: miss-islington (miss-islington) Date: 2020-06-10 01:26
New changeset 73b728a779aa7d6d8f088c4b21447bba4bf3a351 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-34003: Re-add versionchanged entry in csv docs (GH-20657) (GH-20770)
https://github.com/python/cpython/commit/73b728a779aa7d6d8f088c4b21447bba4bf3a351
History
Date User Action Args
2022-04-11 14:59:02adminsetgithub: 78184
2020-06-10 01:26:39miss-islingtonsetmessages: + msg371152
2020-06-10 01:26:19miss-islingtonsetmessages: + msg371151
2020-06-10 01:02:52miss-islingtonsetpull_requests: + pull_request19969
2020-06-10 01:02:39miss-islingtonsetpull_requests: + pull_request19968
2020-06-10 01:02:15miss-islingtonsetnosy: + miss-islington
messages: + msg371148
2020-06-05 19:08:14eric.araujosetnosy: + eric.araujo

pull_requests: + pull_request19876
2019-02-01 03:02:18rhettingersetresolution: not a bug -> fixed
2019-02-01 03:02:05rhettingersetstatus: open -> closed
resolution: not a bug
stage: patch review -> resolved
2019-01-31 08:47:55rhettingersetmessages: + msg334613
2018-06-30 00:50:21rhettingersetnosy: + rhettinger
messages: + msg320748
2018-06-29 21:13:07seliksetmessages: + msg320741
2018-06-29 20:55:06eric.smithsetnosy: + eric.smith
messages: + msg320739
2018-06-29 20:02:17seliksettype: performance
2018-06-29 20:02:00seliksetcomponents: + Library (Lib)
2018-06-29 19:59:52seliksetmessages: + msg320735
2018-06-29 19:59:33seliksetkeywords: + patch
stage: patch review
pull_requests: + pull_request7622
2018-06-29 19:47:39selikcreate