[IPython-dev] splitter not transforming a line

Thomas Kluyver takowl@gmail....
Tue Sep 25 07:35:36 CDT 2012


On 25 September 2012 13:22, Jason Grout <jason-sage@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:
https://github.com/ipython/ipython/pull/2301

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.

Thanks,
Thomas


More information about the IPython-dev mailing list