"Brett Cannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > See, this is what I am worried about. I **really** like not having to > figure out what I need to do to read by lines from a file. If the > FileStream object had an __iter__ that did the proper wrapping with > LinedBufferedStream, then great, I'm happy. But if we do not add some > reasonable convenience functions or iterators, this is going to feel > rather heavy-handed rather quickly.
Perhaps open() could take a parameter to specify the iteraton chunk: bytes, chars, words, lines, para(graph)s, blocks of size n, splits on string s. I think it somewhat common that an outer line loop contains an inner loop for the true iteration chunk (most often, bytes or the result of split()). The double loop is only there because that is what is easier. Terry Jan Reedy _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
