[issue17537] csv.DictReader should fail if >1 column has the same name

2021-06-21 Thread Irit Katriel
Irit Katriel added the comment: It's not hard to write a helper function that checks whether a csv has duplicated columns: def unique_cols(filename): cols = next(csv.reader(open(filename,'r'))) return len(cols) == len(set(cols)) >>> with open('x.csv', 'w') as f: ... f.write('foo,ba

[issue17537] csv.DictReader should fail if >1 column has the same name

2013-03-24 Thread R. David Murray
R. David Murray added the comment: I haven't read the thread that Ned points to, but I do note that replacing the value is exactly how Python dict literals work. Also, even if we decide that we want an error, I don't think it is a change that could be backported, since it could easily make cur

[issue17537] csv.DictReader should fail if >1 column has the same name

2013-03-24 Thread Ned Deily
Ned Deily added the comment: Note that there was a long discussion a couple of months ago on python-ideas about the csv module including the issue of duplicate names. There were differing opinions about whether this behavior should be changed and, if so, how. It starts here: http://mail.pyth

[issue17537] csv.DictReader should fail if >1 column has the same name

2013-03-24 Thread Ned Deily
Changes by Ned Deily : -- nosy: -ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.