classification
Title: Make the dict type used in csv.DictReader configurable
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: asaka, rhettinger, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2017-12-15 19:00 by serhiy.storchaka, last changed 2021-12-17 11:07 by asaka.

Pull Requests
URL Status Linked Edit
PR 4904 closed shangdahao, 2017-12-16 14:01
Messages (3)
msg308420 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-15 19:00
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.
msg308434 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2017-12-16 00:25
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.
msg408771 - (view) Author: AN Long (asaka) * Date: 2021-12-17 11:07
As https://github.com/python/cpython/pull/4904 is closed now, I think this issue should be closed now?
History
Date User Action Args
2021-12-17 11:07:10asakasetnosy: + asaka
messages: + msg408771
2017-12-16 14:01:52shangdahaosetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request4799
2017-12-16 00:25:09rhettingersetnosy: + rhettinger
messages: + msg308434
2017-12-15 19:00:53serhiy.storchakacreate