3 ms·
I don't think print() is what I'd call "compelling", but I for one am quite glad to see this go: print "Text", For those not familiar with Python 2's synt
by deathanatos 9y ago
I don't think print() is what I'd call "compelling", but I for one am quite glad to see this go:
print "Text",
For those not familiar with Python 2's syntax: that trailing comma is significant. And it's pure syntax; it's not the creation of a tuple either…
- deleted 9y ago[deleted]
- nayuki 9y agoIt gets weirder in the old syntax when you specify an output stream: print >>sys.stderr, "Spam" Whereas in the new print function it's a keyword argument: print("Spam", file=sys.stderr)
- comex 9y agoIt’s awful, especially since you can’t omit the space at the end. But the replacement, print(“Text”, end=“”) is verbose. Not too verbose, but considering how often I write prints as temporary throwaway code, every little bit hurts…