Some Python 2.1 ideas

Bjorn Pettersen pbjorn at uswest.net
Sun Dec 24 21:45:04 CET 2000


Thomas Wouters wrote:

> On Sun, Dec 24, 2000 at 12:24:13PM -0700, Bjorn Pettersen wrote:
> > Greg Jorgensen wrote:
>
> > > "Bjorn Pettersen" <pbjorn at uswest.net> wrote in message
> > > [snip]
> > > How should these be handled?
>
> > >   "foo\n\n\n"
> > >   "foo\n\r\n\r"
> >
> > "foo\n\n\n" -> "foo\n\n"
> > "foo\n\r\n\r" -> "foo\n\r"
>
> Note that the latter was a trick question! The proper order for DOS-EOL is
> '\r\n', *not* '\n\r'. So the string "foo\n\r\n\r" is a Macintosh string, not
> a DOS one :-)

Sorry, I thought I remembered that Macintosh used \n\r and not just \r. Shows you how
much I work with Macs ;-)

I think the rule I was trying to follow was "the longest sequence that can be
recognized as a line terminator".

-- bjorn

ps: anyone know what the line terminator for OS X is? (My old NeXT used the regular
unix conventions..)





More information about the Python-list mailing list