[Python-Dev] Replacement for print in Python 3.0

Meyer, Tony T.A.Meyer at massey.ac.nz
Fri Sep 2 04:54:19 CEST 2005


[Guido]
> The print statement harks back to ABC and even
> (unvisual) Basic. Out with it!

[Barry]
> I have to strongly disagree. 

As would I.  From observing recent discussions here, it would be helpful if everyone else that agrees could come up with a list (a wiki page on python.org, perhaps?) of simple, to-the-point, reasons why losing print is a bad idea.  Once Guido sees the huge list of reasons in favour of keeping it, versus the one or two reasons against it (and ruminates on it while 2.5 through 2.9 are released) I'm sure he'll see reason.

FWIW, I wouldn't really care if >> or the trailing comma was lost.

[Barry]
> The print statement is simple, easy to understand, and
> easy to use.  For use cases like debugging or the interactive
> interpreter [...] I think it's hard to beat the useability
> of print with a write() function, even if builtin.

ISTM that Barry nails the key reasons here.  One of the real strengths of Python is that it can be used in a wide range of applications, many of which don't need to be burdened with a complex logging strategy, don't have a GUI, aren't inside a web browser, and so on.

"print" is the best example I can think of for "practicality beats purity".  Writing to stdout is as common in the code I write as loops - it's worth keeping such basic functionality as elegant, simple, easy to understand, and easy to use as possible.  (This is certainly my motiviation, not any concern about backwards compatibility).

With standard English keyboards, at least, the '(' and ')' keys are also inconvenient to type, compared to lower-case English characters.  Fundamental actions like writing to stdout deserve simplicity.

=Tony.Meyer


More information about the Python-Dev mailing list