Make print() not append line break by default
On Sun, Jan 19, 2014 at 11:47 AM, <musicdenotation@gmail.com> wrote:
And add println()
Python 2: def echo(msg, lineend=''): import sys sys.stdout.write(msg + lineend) It is better than having dozen of print functions in documentation that make this documentation unreadable. -- anatoly t.
I think this is a great suggestion if the goal is to break lots of programs for no good reason. Can we rename 'dict' to 'map' while we're at it? </sarcasm> The best suggestions are motivated by an actual problem or use case. There's no problem here. Just use: print(..., end='') The bar for breaking changes is very high. This is -100 on a scale of 0 to 10. --- Bruce I'm hiring: http://www.cadencemd.com/info/jobs Latest blog post: Alice's Puzzle Page http://www.vroospeak.com Learn how hackers think: http://j.mp/gruyere-security On Sun, Jan 19, 2014 at 12:47 AM, <musicdenotation@gmail.com> wrote:
And add println() _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
On Sun, Jan 19, 2014 at 03:47:00PM +0700, musicdenotation@gmail.com wrote:
And add println()
Print natural log? For the major use cases print is designed for, you want it to print a newline at the end. For those rare times you don't, print(..., end='') is simple enough. Besides, print has inserted a newline at the end since at least Python 1.5. There is a lot of code relying on that behaviour. Even if we wanted to change, backwards-compatibility considerations would prevent it. -- Steven
participants (4)
-
anatoly techtonik
-
Bruce Leban
-
musicdenotation@gmail.com
-
Steven D'Aprano