[IPython-user] %ed returns "\n"

Fernando Perez Fernando.Perez at colorado.edu
Fri Jan 27 19:06:21 CST 2006

Ville Vainio wrote:
> On 1/28/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
>>_that_ would be nice.  %whos uses the same technique to snip strings, there I
>>keep the beginning and end, I'd suggest doing something similar (also for
>>consistency across ipython).  Not identical (whos truncates to a single line),
>>but similar enough that it 'feels right'.  Whatever that is :)
> Good point, I'll look into %whos.
> Here's something even more insane (bear with me, it's 3am here): if
> one uses %ed for editing the same file repeatedly, we could show the
> DIFFS to the previous version of that file after editing. It's very
> easy (and dependency-free) with difflib, and could serve as a very
> concise summary of that version of the file (and hence a good guide
> for looking for the right version of the file), provided that the
> changes were relatively small.

Sure, get some feedback from others first though...  Note that %edit is ripe 
for a big cleanup, it's one big monster.  Ideally, magics should do little 
more than parse arguments and call underlying functionality of the object. 
Today they don't, and some (%run and %edit are the worse) do a TON of work 
themselves.  Good candidates for cleanup, but tread lightly (those two are 
probably the most heavily used parts of ipython)

But don't implement it at 3 am :)


More information about the IPython-user mailing list