[IPython-dev] splitter not transforming a line

Thomas Kluyver takowl at gmail.com
Tue Sep 25 08:35:36 EDT 2012

On 25 September 2012 13:22, Jason Grout <jason-sage at creativetrax.com> wrote:
> Is this intentional?  There seem to be enough comments like
> https://github.com/ipython/ipython/blob/master/IPython/core/inputsplitter.py#L883
> that indicate that maybe this is an oversight in a tricky part of the code.

It is quite possibly an oversight - all of that part of the code is
complex. Sorry, my work on IPEP2 has been sidelined while I've been
pushing Pylab forwards.

> Since it is not complete and the buffer has the @interact line in it and
> the @interact line does not end with ':' or ',', the transform is never
> run.  This is a big problem for Sage, since Sage wants to transform that
> 1 to Integer(1) in the preparser.

Once it's in place, I would encourage you to do this with the new AST
transformation hook:

This was inspired by Sympy wanting to do exactly the same
transformation. I still need to do a bit of work, but I think I can
see how to complete it.


More information about the IPython-dev mailing list