Linux.com: Python 3 makes a big break
exarkun at divmod.com
Sat Oct 18 22:01:13 CEST 2008
On Sat, 18 Oct 2008 15:30:23 -0400, Terry Reedy <tjreedy at udel.edu> wrote:
>Interesting article with one minor incompleteness.
>"For instance, the print statement got turned into a print function; you
>must now put parentheses around what you want to print to the screen. The
>change allows developers to work with print in a more flexible and uniform
>way. If someone needs to replace the print function with some other action,
>it can be done with a universal search and replace, rather than rewriting
>each print statement by hand."
>Even easier, print as a function can be replaced simply by defining a new
>version with the same name. No search/replace is needed. And reversion to
>the built-in only requires commenting out the replacement.
Perhaps it also omitted the fact that nothing prevents you from defining a
function to write things to stdout (or elsewhere) in Python 2.5, making the
Python 3.x change largely a non-feature. ;)
More information about the Python-list