[Python-Dev] Replacement for print in Python 3.0

Nick Coghlan ncoghlan at gmail.com
Sat Sep 3 03:13:21 CEST 2005


Paul Moore wrote:
> No-one is saying "crucial". We're just expressing opinions. But so are
> those (even Guido!) who want to remove the print statement. No-one has
> come up with a genuine, objective benefit to removing it (that I can
> see). If there isn't one, then we're left with preferences, and
> Guido's trumps everyone else's. You (as someone who agrees with Guido)
> don't have anything to prove. Those of us who want to change Guido's
> mind need to impress him with the strength of our opinions :-).

"Print as statement" => printing sequences nicely is a pain
"Print as function" => extended call syntax deals with sequences nicely

"Print as statement" => can't easily change the separator
"Print as function" => keyword argument handles the separator nicely

"Print as statement" => trailing comma suppresses newline by magic
"Print as function" => keyword argument handles the line terminator nicely

"Print as statement" => redirection is via a magic symbol
"Print as function" => keyword argument handles redirection nicely

"Print as statement" => can't easily save 'settings' for re-use
"Print as function" => can use functional.partial to create custom version

See my other post where I present a Python 2.4 implementation of a function
called "output" which does everything I describe above.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com


More information about the Python-Dev mailing list