New submission from Steve Holden: It's sometimes annoying that a csv.DictReader doesn't retain the field ordering given in the first line of the file. Sometimes it matters.
This patch converts the reader so that it returns an OrderedDict rather than a plain dict, thereby retaining the ordering. All tests still pass (though I haven't yet added a test to verify that the field ordering *is* retained - didn't think it was worth it if the patch won't be added, but will happily add that test otherwise). I have updated the documentation, but was unable in the time available to find out how to correctly reference the OrderedDict class so that it was correctly hyperlinked. ---------- components: Library (Lib) files: csv.patch hgrepos: 353 keywords: needs review, patch messages: 273486 nosy: holdenweb priority: normal severity: normal stage: patch review status: open title: Order CSV header fields versions: Python 3.6 Added file: http://bugs.python.org/file44202/csv.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27842> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com