#10933: time of magma command fails inside function
--------------------------+-------------------------------------------------
Reporter: mariah | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.7
Component: interfaces | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Comment(by was):
{{{
sage: def foo(s):
....: time gp(s)
....:
sage: foo('1')
NameError: name 's' is not defined
}}}
This might also be relevant:
{{{
sage: print preparse("""def foo(str):\n time gp(str)\n\nprint
gp('1')""", do_time=True)
def foo(str):
__time__=misc.cputime(); __wall__=misc.walltime(); gp(str); print
"Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__),
misc.walltime(__wall__))
print gp('1')
sage: def foo(str):
....: __time__=misc.cputime(); __wall__=misc.walltime(); gp(str);
print "Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__),
misc.walltime(__wall__))
....:
sage:
sage: foo('1')
Time: CPU 0.00 s, Wall: 0.00 s
}}}
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...
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10933#comment:2>
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.