-
-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from __future__ import <anything> results in a Syntax Error #7207
Comments
Fixed formatting to relocate future imports to the top of the file. |
Author: Tim Dumol |
comment:1
Attachment: trac_7207-sagenb-future-import.patch.gz |
comment:2
Would anyone mind reviewing this? It just moves the |
comment:3
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:
outputs:
whereas the similar
works fine. I think the right fix is to require that the even in the notebook the |
Uses stdlib's |
comment:4
Attachment: trac_7207-sagenb-future-import.2.patch.gz This version of the patch uses |
Attachment: trac_7207-sagenb-future-import.2.2.patch.gz Rebased on #7650 and its dependencies. |
Attachment: trac_7207-sagenb-future-import.2.3.patch.gz Missed an import on the rebase. |
Attachment: trac_7207-sagenb-future-import.3.patch.gz Rebased to ~0.60 |
comment:5
Rebased to a bit after 0.60 (see trac_7207-sagenb-future-import.3.patch). Other than that LGTM. |
Reviewer: Alex Leone |
comment:6
V4 is rebased for this queue:
|
Rebased for SageNB 0.6 + queue in comment. Replaces previous. |
Merged: sagenb-0.7 |
comment:7
Attachment: trac_7207-sagenb-future-import.4.patch.gz |
from
futureimport *
statements must be the first statements in a file. However, the old Sage Notebook inserts synchronization code before the file, and the new SageNB inserts prompt changing code first. Both of the aforementioned changes break the code.CC: @qed777 @williamstein
Component: notebook
Author: Tim Dumol
Reviewer: Alex Leone
Merged: sagenb-0.7
Issue created by migration from https://trac.sagemath.org/ticket/7207
The text was updated successfully, but these errors were encountered: