Jon Dufresne added the comment:

I have created an initial patch such that writerow() now allows generators. I 
have also added a unit test to demonstrate the fix.

The code now coerces iterators (and generators) to a list, then operates on the 
result. I would have preferred to simply iterate over the argument, however, 
there is a special case where the length of the argument is exactly 1. So 
coercing to a list makes checking the length simpler.

All feedback welcome.

----------
keywords: +patch
Added file: http://bugs.python.org/file37609/csv-gen.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23171>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to