[Python-3000] Draft PEP for New IO system

Steven Bethard steven.bethard at gmail.com
Tue Feb 27 16:09:21 CET 2007


On 2/27/07, Paul Moore <p.f.moore at gmail.com> wrote:
> >     .__init__(self, buffer, encoding=None, newline=None)
> >
> >        Same as above but if newline is not None use that as the
> > newline pattern (for reading and writing), and if newline is not set
> > attempt to find the newline pattern from the file and if we can't for
> > some reason use the system default newline pattern.
>
> I'm not sure that can work - the point of universal newlines is that
> *any* of \n, \r or \r\n count as a newline, so there's no one pattern.
> So I think that explicitly specifying universal newlines is necessary
> (even though it's clunky).

Maybe there could be a special UNIVERSAL constant, so you'd write
something like::

    TextIOWrapper(buffer, newline=UNIVERSAL)

?

Steve
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy


More information about the Python-3000 mailing list