Author lsowen
Recipients lsowen
Date 2016-07-12.15:14:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468336448.04.0.83850338242.issue27497@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, DictWriter.writeheader() is defined like:

    def writeheader(self):
        header = dict(zip(self.fieldnames, self.fieldnames))
        self.writerow(header)

It would be useful to have it return the value of writerow():

    def writeheader(self):
        header = dict(zip(self.fieldnames, self.fieldnames))
        return self.writerow(header)

This would useful because:
1) It would match the behavior of DictWriter.writerow
2) It would enable DictWriter.writeheader to be used in within a generator function (ala https://docs.djangoproject.com/en/1.9/howto/outputting-csv/#streaming-large-csv-files)
History
Date User Action Args
2016-07-12 15:14:08lsowensetrecipients: + lsowen
2016-07-12 15:14:08lsowensetmessageid: <1468336448.04.0.83850338242.issue27497@psf.upfronthosting.co.za>
2016-07-12 15:14:08lsowenlinkissue27497 messages
2016-07-12 15:14:07lsowencreate