#797: [with patch, needs review] %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:  timeit ipython  |  
----------------------------+-----------------------------------------------
Changes (by SimonKing):

  * keywords:  => timeit ipython
  * summary:  %timeit doesn't recognize [1..10] syntax => [with patch,
              needs review] %timeit doesn't recognize [1..10]
              syntax

Comment:

 In `preparse_ipython`, lines starting with `%` have not been changed
 unless they refer to some interface. I added support for `%timeit`.

 Idea: Call `timeit.eval`

 With the patch, the following examples now work:
 {{{
 sage: %timeit [1..10]
 625 loops, best of 3: 127 µs per loop
 sage: %timeit 'a'=="a"
 625 loops, best of 3: 285 ns per loop
 }}}
 and the other ways of calling the timer still work:
 {{{
 sage: %time [1..10]
 CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
 sage: timeit('[1..10]')
 625 loops, best of 3: 127 µs per loop
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/797#comment:13>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to