#7207: from __future__ import <anything> results in a Syntax Error
------------------------+---------------------------------------------------
Reporter: timdumol | Owner: boothby
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.3
Component: notebook | Keywords:
Work_issues: | Author: Tim Dumol
Upstream: N/A | Reviewer:
Merged: |
------------------------+---------------------------------------------------
Changes (by was):
* status: needs_review => needs_work
Comment:
Needs work, since this has a subtle bug, which I bet you can easily fix.
See below.
Using regular expressions is unfortunately not rock solid. For example,
this input "mysteriously" gives a SyntaxError:
{{{
print """
from __future__ import division"""
}}}
outputs:
{{{
Syntax Error:
from __future__ import division"""
}}}
whereas the similar
{{{
print """
from __xfuture__ import division"""
}}}
works fine.
I think the right fix is to require that the even in the notebook the
{{{from __future__ import ...}}} lines appear at the very top. This would
make it possible to use the same method you already used.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7207#comment:3>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.