from __future__ import print

Lie Lie.1296 at gmail.com
Sun Apr 20 07:33:38 EDT 2008


On Apr 13, 7:23 pm, Roy Smith <r... at panix.com> wrote:
> In article
> <ce23a66d-ac4b-4f23-a9ea-8d1592b08... at w8g2000prd.googlegroups.com>,
>
>  Lie <Lie.1... at gmail.com> wrote:
> >  I wish py3k
> > would make it an option whether to treat print as statement or
> > function though.
>
> Arrrgghhhhh!  No, don't even go there.  If you want optional parens, use
> Perl :-)

Not optional parens, but a simple print statement coupled with a
powerful print function. This print statement would only have basic
printing functionality such as :

print "Hello"
print var
print var, "Hello too"

specifically, these would be removed:
print var,
print >> unstdout, var

This is because it is sometimes annoying to type this:
print("Hello")
print("World")
print("This")
print("is")
print("Captain")
print("Kirk")

because of the double enclosement (parens () and quotes ""),
especially when you're just slipping a simple debugging statement.

This also eases transition between older codes, because while you uses
regular print statements everyday, you don't do print redirection and
comma-ended printing everyday, and it would be easier to just convert
those advanced printing functionality rather than converting all
printing statements.



More information about the Python-list mailing list