[IPython-user] bug in edit magic: content of edited file is not accessible

Fernando Perez Fernando.Perez at colorado.edu
Thu Jan 12 12:32:02 CST 2006


Alexander Belchenko wrote:
> Fernando Perez пишет:
> 
>>Alexander Belchenko wrote:
>>
>>
>>>In 0.6.15 when I edit file with edit magic command I've got content of 
>>>edited file in last Out variable. In 0.7.0 this is broken: after editing 
>>>code was executed but text is not accessible as _X variable. Is this 
>>>intended behaviour? I think it's a bug.
>>
>>Well, I deliberately removed that return statement, because I was finding it 
>>annoying to get all that output, just after I'd been editing the file anyways. 
>>  If you could clarify your usage case for needing that info back as a 
>>variable, I can come up with a decent solution for the various cases.
> 
> 
> My use case:
> 
> - Using edit for handy editing of chunks of experimental python code in 
> external editor (with syntax coloring)
> - After each edit IPython execute my code and I debug it on-the-fly
> - When I have errors in my chunk I need re-edit this chunk
> - But sometimes I want to return not to previous edited code but more 
> earlier. Because last edit may introduce more errors (syntax or logical) 
> then I expect. In this case is better to return to more stable point.
> - So I need to easy re-edit not only last edited chunk
> 
> I'm OK if text of last edited file will not showed on the screen in 
> IPython session. But at least I'd like to have possibility to have 
> access to previously edited code as _X variable. As it was before. It's 
> very handy.

OK, I see your point.  Automatic versioned source control was a feature of 
ipython all along, and I didn't even know it.  Who needs SVN when you have 
ipython  ;)

I'll revert the old behavior.

Cheers,

f




More information about the IPython-user mailing list