from __future__ import print

Lie Lie.1296 at gmail.com
Sun Apr 13 05:09:45 EDT 2008


On Apr 11, 7:26 pm, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:
> samsli... at gmail.com a écrit :
>
> > Am I the only one that thinks this would be useful?  :)
>
> > I'd really like to be able to use python 3.0's print statement in
> > 2.x.
>
> <nitpick mode="pedantic">
> FWIW, the whole point is that in 3.0, print stop being a statement to
> become a function...
> </nitpick>

But the reason it becomes a function is because being a statement it
is inflexible and there is no way to pass arguments to the print
function, at the cost of extra typing of parentheses. I wish py3k
would make it an option whether to treat print as statement or
function though. Since not all programs require the power of print as
a function and having to type the extra parentheses is a bit tiring if
you're printing lots of things. Probably it may be coupled with a
translator (for source code from statement to function, since the
reverse would not be practical) if you changed your mind.



More information about the Python-list mailing list