[Python-3000] Draft PEP for New IO system
p.f.moore at gmail.com
Tue Feb 27 17:59:24 CET 2007
On 27/02/07, Guido van Rossum <guido at python.org> wrote:
> On 2/27/07, Paul Moore <p.f.moore at gmail.com> wrote:
> > Documenting the revised open() factory in this PEP would be useful. It
> > needs to address encoding issues, so it's not a simple copy of the
> > existing open().
> Check the doc again. I added on at the end. It could use some review.
> I also added an elaboration into the p3yk branch in svn; that could
> use some review as well.
Sorry, I hadn't checked the updated version. I'll take a look.
> I think for input we should always accept all three line endings so
> you never need to specify anything; for output, we should pick a
> platform default (\r\n on Windows, \n everywhere else) and have an API
> to override it. So the API you quote above sounds about right:
> .__init__(self, buffer, encoding=None, newline=None)
> I'd like to constrain newline to be either \n or \r\n for writing; for
> reading IMO it should not be specified.
Ah. If that's the intent, I agree - in effect universal newlines is
always on, and output uses platform semantics unless you force it to
Forcing only \n or \r\n sounds fine to me.
More information about the Python-3000