This pull request makes it possible to modify the transforms applied and also modifies the transformation code to pass the line numbers.
This isn't ready to be merged (I'm sure there are other places in the code that would need to be changed), but it does illustrate the sorts of changes that would be great for the Sage customizations.
See also http://mail.scipy.org/pipermail/ipython-dev/2012-September/010239.html
(WIP stands for Work in Progress...)
Move transforms to be an attribute of the class so they can be modifi…
…ed by extensions.
Make transformations take the line number as well as the line string.
For backwards compatibility, we could also inspect the function to see if it takes 2 arguments, and if not, just pass in the line string.
Thanks - I'm not sure line number is quite the right way to do this, but I do have some kind of stateful transformers in mind. And I agree that we need to move the list of transformations out where it can be accessed.
(This falls under the heading of #2293, aka IPEP 2)
@jasongrout I'm going to close this one in favour of #2447 - I'm trying to bring our PR count down a bit. Do keep an eye on that one.