Linux.com: Python 3 makes a big break

Jean-Paul Calderone exarkun at divmod.com
Sat Oct 18 16:01:13 EDT 2008


On Sat, 18 Oct 2008 15:30:23 -0400, Terry Reedy <tjreedy at udel.edu> wrote:
>http://www.linux.com/feature/150399
>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. ;)

Jean-Paul



More information about the Python-list mailing list