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: rhettinger, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2017-12-15 19:00 by serhiy.storchaka, last changed 2017-12-16 14:01 by shangdahao.

Pull Requests
URL Status Linked Edit
PR 4904 closed shangdahao, 2017-12-16 14:01
Messages (2)
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.
History
Date User Action Args
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