[IPython-User] iPython notebook and statements that span multiple lines

Thomas Kluyver takowl@gmail....
Mon Nov 12 12:12:41 CST 2012


On 12 November 2012 18:02, Aaron Meurer <asmeurer@gmail.com> wrote:

> Will this change at least for %timeit with the new ast transformation
> logic from https://github.com/ipython/ipython/pull/2301?
>

It's not planned to - the AST transformation happens after magic commands
have already been processed, because we need to be able to parse valid
Python code by that point.

The added complexity of special-casing %timeit and trying to work out when
it's complete isn't worth the relatively small benefit. If you want to time
multi-line code, use a cell magic. Or, when stateful transformers land,
mark line continuations with backslashes.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121112/3e001699/attachment.html 


More information about the IPython-User mailing list