[Python-ideas] Iterating non-newline-separated files should be easier
Guido van Rossum
guido at python.org
Sat Jul 19 22:05:32 CEST 2014
I don't have time for this thread.
I never meant to suggest anything that would require pushing back data into
the buffer (you must have misread me).
I don't like changing the meaning of the newline argument to open (and it
doesn't solve enough use cases any way).
I personally think it's preposterous to use \0 as a separator for text
files (nothing screams binary data like a null byte :-).
I don't think it's a big deal if a method named readline() returns a record
that doesn't end in a \n character.
I value the equivalence of __next__() and readline().
I still think you should solve this using a wrapper class (that does its
own buffering if necessary, and implements the rest of the stream protocol
for the benefit of other consumers of some of the data).
Once a suitable wrapper class has been implemented as a 3rd party module
and is in common use you may petition to have it added to the standard
library, as a separate module/class/function.
--
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140719/8efa3ec4/attachment.html>
More information about the Python-ideas
mailing list