On Fri, Mar 21, 2014 at 11:59 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > The rule of three applies here: anything you do in three different places > ought to be managed by a function. Printing a newline at the end of a > line of output is *incredibly* common. Any language which fails to > provide a print-with-newline function is, frankly, sub-standard.
I wouldn't go that far. There are plenty of languages where the default (printf, write, werror, etc) doesn't add the newline, and I wouldn't call the *language* sub-standard for that. But yes, it does bug me now and then. I use my "say" function to produce one or more lines of output in Gypsum, and it guarantees complete lines (because the system works with lines, not streams of characters); and then if I use the "werror" function to write to stderr, I have to remember to add the newline. However, I think Py2's print statement has way too many weirdnesses - the trailing comma (reminiscent of BASIC, where I never liked it either), the whole "soft space" concept, etc. Py3's print function, with the keyword end="", is a lot better, though still a tad verbose. (I don't know of any solution to that.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list