On Tue, Jul 13, 2021 at 9:00 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:

> As it stands, writelines is consistent with readlines.  Both preserve
> newlines.
>

indeed. so if this idea is to be done (and there's something to be said for
it), I think a similar option should be added to readlines as well --
striping the newline.

A couple other notes:

This would highlight the whole "a string is an iterable of strings" problem
:-( -- should strings be special cased? I think not, that's an issue that
Python programmers have to learn at one point or another anyway.

As for whether it always puts in a newline, or if you can specify what you
want to put in , I vote for the newline -- newlines are not the same on all
platforms (though TextIO does translate), but I think it would get a bit
confusing if someone explicitly put in "\n| and got "\r\n".

And the name IS writeLINES -- so why would anyone expect to use it for
anything else -- we still have str.join() after all.

-CHB
-- 
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TWZHPL7ZP3MQTIAAQTEAOWZW43P3LIW3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to