"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Summarizing, my main problems with print as a statement are the > transformations -- when print doesn't cut it, you have to switch to > something entirely different. If it were a function the switch would > feel much smoother. I find that important: things that are > conceptually related should be syntactically related (within the realm > of common sense, as always).
Letting go of my attachment to the status quo, I see a couple of reasons to make print syntactically a function that I had not noticed before. 1. In C, for instance, *all* I/O is done with functions. In Python, *almost all* I/O constructs are functions, but with one exception. This makes the language slightly harder to learn. Many newbies expect uniformity and many have posted code treating print as a function by adding the currently unneeded parentheses. They have to be taught the exception. 2. I/O constructs carry with them assumptions about the environment or peripherals of the computatonal entity. Print, in particular, assumes the presence of a special default character display device (ok, a stdout char stream). Making print a syntax contruct builds that assumption into the syntax. That violates separation of concern principles and makes Python slightly harder to port to systems for which that assumption is not true and for which 'print' might even be meaningless. So I disagree that printing lines of text is fundamental to computation as such. It is certainly no more fundamental than input. And I notice that no one has suggested that (raw)input should be turned into a statement ;-). Terry J. Reedy _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com