Daniel Lescohier <daniel.lescoh...@cbs.com> added the comment: 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. ---------- message_count: 4.0 -> 5.0 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5445> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com