I just thought about something. Would making readline(s) not glob the
line breaking character be a too radical idea? I think that is what
most people are expecting from a readline function, anyway. I often
see things like [line.strip() for line in open(file).readlines()],
which is not so elegant IMHO.

This should be accompanied with a change to writelines that would make
it appends to each line the platform-specific line breaking character,
as defined by os.linesep.

The main objections I would against the change is obviously breaking
backward-compatibility, and losing the closure property of
readlines/writelines -- i.e., after g.writelines(f.readlines()), g
wouldn't have the guarantee to have the same content of f. On the
other hand, this could give Python a neat way to convert line breaking
characters.

Anyway, that was just a random thought. I don't think the change is
worthwhile enough, to break backward-compatibility.

-- Alexandre
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to