[Python-Dev] Replacement for print in Python 3.0
Martin Blais
martin.blais at gmail.com
Fri Sep 2 06:40:42 CEST 2005
On 9/1/05, Bill Janssen <janssen at parc.com> wrote:
> > Providing you can live with adding a pair of parentheses to that, you can
> > have:
> >
> > def print(*args):
> > sys.stdout.write(' '.join(args) + '\n')
> >
> > I think the language would be cleaner if it lacked this weird exception for
> > `print`.
>
> Charles,
>
> I agree that it would be cleaner. I just don't think cleanliness is
> all that interesting -- usefulness trumps it every time. And if
Talking about cleanliness, I'm not sure which is cleaner::
print >> sys.stderr, "This is a long sentence that I " \
"had to cut in two."
print("This is a long sentence that I "
"had to cut in two.", stream=sys.stderr)
Sometimes I'll do this because I don't like the backslashes::
print >> sys.stderr, ("This is a long sentence that "
"Had to cut in two.")
Also, I find the ">>" syntax has always bothered me.
I find it useful but so out-of-place in the language.
+1 for removing the print statement.
More information about the Python-Dev
mailing list