#797: %timeit doesn't recognize [1..10] syntax
----------------------------+-----------------------------------------------
Reporter: jason | Owner: was
Type: defect | Status: reopened
Priority: minor | Milestone: sage-3.4.1
Component: user interface | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by mhansen):
When you run %timeit from the command-line, it runs code in IPython and
does not touch any code in the Sage library. The issue is that the
IPython magic command "%timeit" doesn't do the preparsing. Fernando was
working on an upstream fix for this. An easy downstream fix for this
would be to do as I suggested above and overwrite the IPython version of
timeit with our own with the expose_magic function.
{{{
sage: _ip.expose_magic("timeit", lambda self, s: timeit(s))
sage: %timeit [1..10]
625 loops, best of 3: 58.4 µs per loop
}}}
The right place to put this would probably be in
local/bin/ipy_profile_sage.py.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/797#comment:11>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---