#15989: Python 3 preparation: Change print statement to print() function
----------------------------+----------------------------
Reporter: wluebbe | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.2
Component: distribution | Keywords: python3
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
----------------------------+----------------------------
To be Python 2 compatible all affected modules need a {{{from __future__
import print_function}}}.
{{{lib2to3/fixes/fix_import.py}}} does not add these !__future!__
imports.[[br]]
Therefore we intend to use an enhanced fixer from
{{{https://pypi.python.org/pypi/future/0.11.3}}}.
Changes according to {{{libfuturize/fixes/fix_print_with_import.py}}}:
{{{
Change:
'print' into 'print()'
'print ...' into 'print(...)'
'print ... ,' into 'print(..., end=" ")'
'print >>x, ...' into 'print(..., file=x)'
No changes are applied if print_function is imported from __future__
--------
Turns any print statements into functions and adds this import line:
from __future__ import print_function
at the top to retain compatibility with Python 2.6+.
}}}
This ticket is tracked as a dependency of meta-ticket ticket:15980.
--
Ticket URL: <http://trac.sagemath.org/ticket/15989>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.