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 Steven.Barker
Recipients Steven.Barker, docs@python
Date 2015-02-20.20:45:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424465153.78.0.58816335685.issue23495@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation for the csv.writer.writerows method says that it expects "a list of row objects", when it really will accept any iterable that yields rows (such as a generator). While it's often nice for code to be more accepting than the documented requirements, I think the docs in this case should state that writerows() expects an iterable, rather than misinforming users that a list is required.

This documentation issue was brought up in a Stack Overflow question here: http://stackoverflow.com/questions/28636848/csv-writer-writerows-takes-iterator

I expect the necessary documentation patch will be pretty trivial, and if nobody else gets to it first, I will try to provide one when I have enough time to update my cpython checkout (not soon, alas).
History
Date User Action Args
2015-02-20 20:45:53Steven.Barkersetrecipients: + Steven.Barker, docs@python
2015-02-20 20:45:53Steven.Barkersetmessageid: <1424465153.78.0.58816335685.issue23495@psf.upfronthosting.co.za>
2015-02-20 20:45:53Steven.Barkerlinkissue23495 messages
2015-02-20 20:45:53Steven.Barkercreate