Message82778
Skip> Let me be more explicit. I don't know how it implements it, but I
think
Skip> you really need to give the user the option of specifying the
field
Skip> names and not reading/writing headers. It can't be implicit as I
Skip> interpreted Rob's earlier comment:
rrenaud> NamedTupleReader and NamedTupleWriter should be inverses.
rrenaud> This means that NamedTupleWriter needs to write headers.
I agree with Skip, we mustn't have a 'wroteheader' flag internal to the
NamedTupleWriter.
Currently to write a 'header' row with a csv.writer you could (for
example) pass a tuple of header names to writerow. NamedTupleWriter
is no different, you would have a namedtuple of header names instead of
a tuple of header names.
I would not like to see another flag added to the initialisation process
to enable the writing of a header row as the 'first' (or any) row
written to a file. We could add a function 'writeheader' that would
write the contents of 'fieldnames' as a row, but I don't like the idea.
Cheers, |
|
Date |
User |
Action |
Args |
2009-02-26 21:03:00 | jdwhitley | set | recipients:
+ jdwhitley, skip.montanaro, barry, rhettinger, rrenaud |
2009-02-26 21:03:00 | jdwhitley | set | messageid: <1235682180.06.0.304519008225.issue1818@psf.upfronthosting.co.za> |
2009-02-26 21:02:58 | jdwhitley | link | issue1818 messages |
2009-02-26 21:02:57 | jdwhitley | create | |
|