Skip to content
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

Input to %timeit is not preparsed #46

Closed
ipython opened this issue May 10, 2010 · 2 comments
Closed

Input to %timeit is not preparsed #46

ipython opened this issue May 10, 2010 · 2 comments
Milestone

Comments

@ipython
Copy link
Collaborator

ipython commented May 10, 2010

Original Launchpad bug 296116: https://bugs.launchpad.net/ipython/+bug/296116
Reported by: fdo.perez (Fernando Perez).

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

Bug reported at SageDays11.

@ipython
Copy link
Collaborator Author

ipython commented May 10, 2010

[ LP comment 1 by: Fernando Perez, on 2008-11-13 07:01:48.986269+00:00 ]

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
4

sage: %timeit 2r+2r

File "", line 6
2r+2r
^
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

@takluyver
Copy link
Member

Isn't it up to sage to do that preparsing? In any case, it seems to work correctly in current stable sage (4.6.2). Closing for now.

minrk pushed a commit to minrk/ipython that referenced this issue Jul 1, 2013
Removed   from html.py

So the In and Out prompts in a static HTML conversion are the same length/aligned.

Normal notebook does not have nbsp either.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant