On 7/13/2021 7:15 AM, sandhoners...@gmail.com wrote:
Right now, writelines is a very big misnomer to many python developers, 
especially beginners who would expect writelines to put new lines at the end of 
every element in the list

My suggestion is to have either a writelines2 or a newline kwarg which does put 
new lines automatically at the end of every line written

I'm skeptical that people who won't read the documentation for writelines will either read the documentation for writelines2, or intuitively understand how it's different from writelines, or would know there's a kwarg parameter to writelines.

It seems your proposal would only matter if the argument were a list? Or does it include tuples and other iterables? If lists, I assume that:

fl.writelines2(['a', 'b', 'c'])

would produce 3 lines:

a
b
c

But what would:

fl.writelines2('abc')

produce? It's an iterable.

Eric

_______________________________________________
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/QGXTUTTBEDZ7ABBTAPNSKWHQM73ZDTIZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to