14 Jul
2021
14 Jul
'21
10:23 a.m.
On Tue, Jul 13, 2021 at 08:59:21AM -0700, Guido van Rossum wrote:
Let's leave poor writelines alone. It's an old API, if you want something different, there are a zillion other ways (e.g. print(*x, sep="\n") ).
I wonder how much research the OP did before they claimed "writelines is a very big misnomer to many python developers".
I don't know about research, but the API certainly fools me. I don't consider the delimiter at the end of the line (the newline) to be part of the line, so whenever I used readlines and writelines I am invariably surprised by the fact that writelines requires the newlines to already be there. I'm also surprised that there's a readline but no writeline :-) -- Steve