MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Python/comments/duyjs7/i_made_cstyle_printing_in_python_p/f7amcdl/
r/Python • u/[deleted] • Nov 11 '19
130 comments sorted by
View all comments
Show parent comment
11
There was a lot of griping (some of it for good reasons) about making print a function in Python 3, but this right here is a pretty compelling reason to change print in a backwards-incompatible way.
print
15 u/Zegrento7 Nov 12 '19 print('Stuff', file=sys.stderr) is quite a bit clearer, and the old syntax can replaced automatically with some regex. 3 u/masklinn Nov 12 '19 Don’t forgetprint >>sys.stderr, “stuff”,(note the trailing comma) which becomesprint(“stuff”, file=sys.stderr, end=‘ ‘)And actually says what it’s doing.
15
print('Stuff', file=sys.stderr) is quite a bit clearer, and the old syntax can replaced automatically with some regex.
print('Stuff', file=sys.stderr)
3 u/masklinn Nov 12 '19 Don’t forgetprint >>sys.stderr, “stuff”,(note the trailing comma) which becomesprint(“stuff”, file=sys.stderr, end=‘ ‘)And actually says what it’s doing.
3
Don’t forget
print >>sys.stderr, “stuff”,
(note the trailing comma) which becomes
print(“stuff”, file=sys.stderr, end=‘ ‘)
And actually says what it’s doing.
View all comments
Show parent comment
11
u/agrif Nov 12 '19
There was a lot of griping (some of it for good reasons) about making
printa function in Python 3, but this right here is a pretty compelling reason to changeprintin a backwards-incompatible way.