[IPython-dev] Sage customizations

Jason Grout jason-sage at creativetrax.com
Tue Sep 11 18:55:30 EDT 2012


On 9/11/12 4:59 PM, Thomas Kluyver wrote:
> On 11 September 2012 22:24, Jason Grout <jason-sage at creativetrax.com> wrote:
>> * transformations are stateless (they only depend on a single line, and
>> shouldn't store state) --- what is the rationale behind this?  For
>> example, we'd like to do a dedenting transformation (useful if we are
>> pasting lots of text, after we turn off autoindenting, or even if we are
>> pasting a lot of single commands with autoindenting).  Of course, to do
>> a dedenting transformation, we need to know the indentation of the first
>> line, so it is not stateless.  Looking at the IPython code, it would be
>> trivial to pass the line number in with the line string to transformations.
>
> Input transformations are still 'in progress' under IPEP 2. Sorry, I
> haven't had much time to work on it lately. Please keep telling me
> about use cases like this - I am building up ideas for how the
> transformation machinery should work, although it's not in a concrete
> form just yet.
>

Thanks.  I know you've been working on this.

I submitted a pull request illustrating the changes I'm talking about. 
I'm sure there are other places in the code that would need to be 
changed for this to be a comprehensive patch.

https://github.com/ipython/ipython/pull/2402

Thanks,

Jason





More information about the IPython-dev mailing list