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
time of magma command fails inside function #10933
Comments
comment:1
This isn't a magma issue per se. I get a similar issue with gp:
|
comment:2
This might also be relevant:
The next thing I might do is look into exactly what Python is executing... there is something funny going on with the preparser not preparsing the input as expected... |
comment:3
OK, investigated this for IPython. The issue is that it evaluates the expression gp(s) within the main user namespace, not within the function's internal namespace (where s lives). Off the top of my head, I can't think of a neat way for the time command to get the namespace from inside the function. |
Attachment: trac_10933.patch.gz |
comment:4
I fixed this by making the preparse_ipython preparse the time just as it already happens in the notebook. |
comment:5
That's ok, but let us hope that is gets fixed in IPython soon. |
Author: Maarten Derickx |
Reviewer: Martin Raum |
comment:6
We're looking at a way to make %time evaluate things in the correct scope, but in the current ipython trunk, auto-magics (like "time" without the %) are only used in single-line inputs. So you'd have to do:
|
comment:7
I've written some simple code to make this work in IPython, if you want to test my branch here: ipython/ipython#295 |
Merged: sage-4.7.alpha5 |
fails with
Component: interfaces
Author: Maarten Derickx
Reviewer: Martin Raum
Merged: sage-4.7.alpha5
Issue created by migration from https://trac.sagemath.org/ticket/10933
The text was updated successfully, but these errors were encountered: