Author rrenaud
Recipients barry, jdwhitley, rhettinger, rrenaud, skip.montanaro
Date 2009-02-26.22:18:39
SpamBayes Score 6.35628e-07
Marked as misclassified No
Message-id <1235686723.19.0.70025441597.issue1818@psf.upfronthosting.co.za>
In-reply-to
Content
I want to make sure I understand.  Am I correct in believing that Skip
thinks writing headers should be optional, while Jervis believes we
should leave the burden to the NamedTupleWriter client?  

I agree that we should not unconditionally write headers, but I think
that we should write headers by default, much like we read them by default.

I believe the implicit header writing is very elegant, and the only
reason that the DictWriter object doesn't write headers is the impedance
mismatch between dicts and CSV.  namedtuples has the field order
information, the impedance mismatch is gone, we should no longer be
hindered.  Implicitly reading but not explicitly writing headers just
seems wrong.

It also seems wrong to require the construction of "header" namedtuple
objects.  It's much less natural than dicts holding identity mappings.

>>> Point._make(Point._fields)
Point(x='x', y='y')

To me, that just looks weird and non-obvious to me.  That Point instance
doesn't really fit in my mind as something that should be a Point.
History
Date User Action Args
2009-02-26 22:18:43rrenaudsetrecipients: + rrenaud, skip.montanaro, barry, rhettinger, jdwhitley
2009-02-26 22:18:43rrenaudsetmessageid: <1235686723.19.0.70025441597.issue1818@psf.upfronthosting.co.za>
2009-02-26 22:18:40rrenaudlinkissue1818 messages
2009-02-26 22:18:39rrenaudcreate