
On 7/13/2021 7:15 AM, sandhoners123@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