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 dlesco
Recipients dlesco, facundobatista, lemburg
Date 2009-03-10.15:36:40
SpamBayes Score 1.5703656e-05
Marked as misclassified No
Message-id <1236699401.94.0.646854639239.issue5445@psf.upfronthosting.co.za>
In-reply-to
Content
Let me give an example of why it's important that writelines 
iteratively writes.  For:

rows = (line[:-1].split('\t') for line in in_file)
projected = (keep_fields(row, 0, 3, 7) for row in rows)
filtered = (row for row in projected if row[2]=='1')
out_file.writelines('\t'.join(row)+'\n' for row in filtered)

For a large input file, for a regular out_file object, this will work. 
For a codecs.StreamWriter wrapped out_file object, this won't work, 
because it's not following the file protocol that writelines should 
iteratively write.
History
Date User Action Args
2009-03-10 15:36:42dlescosetrecipients: + dlesco, lemburg, facundobatista
2009-03-10 15:36:41dlescosetmessageid: <1236699401.94.0.646854639239.issue5445@psf.upfronthosting.co.za>
2009-03-10 15:36:40dlescolinkissue5445 messages
2009-03-10 15:36:40dlescocreate