from __future__ import print
Andrii V. Mishkovskyi
mishok13 at gmail.com
Thu Apr 10 14:06:03 EDT 2008
2008/4/10, samslists at gmail.com <samslists at gmail.com>:
> 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. Is this at least being considered as an option for 2.6? It
> seems like it would be helpful with transitioning.
It's not only considered but have been already implemented. Enjoy. :)
Python 2.6a2+ (trunk:62269, Apr 10 2008, 20:18:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import print_function
>>> print "asd"
File "<stdin>", line 1
print "foo"
^
SyntaxError: invalid syntax
>>> print("foo")
foo
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Wbr, Andrii Mishkovskyi.
He's got a heart of a little child, and he keeps it in a jar on his desk.
More information about the Python-list
mailing list