[Python-ideas] csv.DictReader could handle headers more intelligently. (original) (raw)

Mark Hackett mark.hackett at metoffice.gov.uk
Tue Jan 29 13:30:49 CET 2013


On Tuesday 29 Jan 2013, Steven D'Aprano wrote:

On 29/01/13 04:45, Mark Hackett wrote: > On Monday 28 Jan 2013, MRAB wrote: >> It shouldn't silently drop the columns > > Why not? > > It's adding to a dictionary and adding a duplicate key replaces the > earlier one.

Then adding to a dictionary was a mistake.

I agree.

So don't use DictReader in that case.

We have Oscar with the method to do your own (and looked fairly simple and straightforward). Chris with carefuldictreader. Shane with his dual-retention object.



More information about the Python-ideas mailing list