This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jdwhitley
Recipients barry, jdwhitley, rhettinger, rrenaud, skip.montanaro
Date 2009-02-26.21:02:57
SpamBayes Score 6.8317574e-13
Marked as misclassified No
Message-id <1235682180.06.0.304519008225.issue1818@psf.upfronthosting.co.za>
In-reply-to
Content
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,
History
Date User Action Args
2009-02-26 21:03:00jdwhitleysetrecipients: + jdwhitley, skip.montanaro, barry, rhettinger, rrenaud
2009-02-26 21:03:00jdwhitleysetmessageid: <1235682180.06.0.304519008225.issue1818@psf.upfronthosting.co.za>
2009-02-26 21:02:58jdwhitleylinkissue1818 messages
2009-02-26 21:02:57jdwhitleycreate