python 3's adoption

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Jan 27 02:26:42 EST 2010


On Tue, 26 Jan 2010 22:23:11 -0800, Paul Rubin wrote:

> Steven D'Aprano <steven at REMOVE.THIS.cybersource.com.au> writes:
>> print as a function is more consistent and more convenient than print
>> as a statement.
> 
> Convenience is subjective, but the 3.x 'print' behavior is definitely
> inconsistent (i.e. different from 2.x). 


Sorry, I meant consistent with the rest of Python, which mostly uses 
functions/methods and only rarely statements (e.g. del and import).


> The change makes a lot of my
> code silently produce wrong results, too.  I often print tuples to show
> what a program is doing:
> 
>     print (timestamp, 'transmogrified', blob)
> 
> which in 2.x prints a parenthesized tuple that I can later read back in
> with eval.  That line of code still prints a message, but in a different
> format, instead of throwing an error.


I don't pretend that the transition between statement and function syntax 
will be anything but inconvenient, but I believe the end result will be 
worth it.


-- 
Steven



More information about the Python-list mailing list