[Python-ideas] Iterating non-newline-separated files should be easier

Stephen J. Turnbull stephen at xemacs.org
Sat Jul 19 11:06:59 CEST 2014


Chris Angelico writes:

 > But they might well be the same thing. Look at all the Unix commands
 > that usually separate output with \n, but can be told to separate with
 > \0 instead. If you're reading from something like that, it should be
 > just as easy to split on \n as on \0.

Nick's point is more general, I think, but as a special case consider
a "multiline" record.  What's the right behavior on output from the
application if the newline convention of this particular multiline
differs from that of the rest of the output stream?  IMO this goes
beyond "consenting adults" (YMMV, of course).

Steve


More information about the Python-ideas mailing list