[Python-Dev] Replacement for print in Python 3.0

Calvin Spealman ironfroggy at gmail.com
Thu Sep 8 18:53:09 CEST 2005


On 9/6/05, Guido van Rossum <guido at python.org> wrote:
> On 9/5/05, Calvin Spealman <ironfroggy at gmail.com> wrote:
> > There is a lot of debate over this issue, obviously. Now, I think
> > getting rid of the print statement can lead to ugly code, because a
> > write function would be called as an expression, so where we'd once
> > have prints on their own lines, that wouldn't be the case anymore, and
> > things could get ugly.
> 
> Sounds like FUD to me. Lots of functions/methods exist that *could* be
> embedded in expressions, and never are. Or if they are, there's
> actually a good reason, and then being a mere function (instead of a
> statement) would actually be helpful. Anyway, why would it be
> important that prints are on their own line where so many other
> important actions don't have that privilege?

For the same reason any statement is not an expression. Python doesn't
allow assignments as expression, even though it has been implemented.
Nor imports or function and class definitions. Readability is key.

On the other hand, I actually don't like there being a print statement
at all. We don't live in the days were console software rules and any
other form of interface is an after thought. First-class printing to
standard out seems to make a statement (no pun intended) that the
language is intended for Unix-emulating operating systems (even
Windows does, to some extent) and that anything you don't pipe through
stdout or pull from stdin is something extra tossed in for a special
crowd.

Interface equality and neutrality would be a good thing in the
language. But, I guess what I'm getting at is that if you do give
special case to anything, give it special case properly. If text
console IO is going to be only through functions and not directly in
the language syntax, should it even be a built-in? Bring it to the
level of any other interface API or keep it at its own status, but any
middle ground seems half-hearted.


More information about the Python-Dev mailing list