Input to %timeit is not preparsed

Bug #296116 reported by Fernando Perez on 2008-11-10
Affects Status Importance Assigned to Milestone

Bug Description

%timeit should preparse the input just like %time does.

Bug reported at SageDays11.

Fernando Perez (fdo.perez) wrote :

Examples from sage showing the problem:

sage: %time 2r+2r
CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
Wall time: 0.00 s
sage: %timeit 2r+2r
   File "<magic-timeit>", line 6
SyntaxError: invalid syntax

sage: timeit('2r+2r')
625 loops, best of 3: 128 ns per loop
sage: timeit('2+2')
625 loops, best of 3: 1.84 µs per loop
sage: %timeit 2+2
10000000 loops, best of 3: 124 ns per loop

Changed in ipython:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers