[IPython-user] %edit <object> unable to read tmp file created previously with %edit

Kurt Smith kwmsmith@gmail....
Wed Jan 7 12:22:41 CST 2009


On Wed, Jan 7, 2009 at 1:52 AM, Ville M. Vainio <vivainio@gmail.com> wrote:

> On Wed, Jan 7, 2009 at 7:17 AM, Kurt Smith <kwmsmith@gmail.com> wrote:
>
> > I can %ed an empty file fine, but I can't %ed an object defined in that
> > file.
>
> You can %ed a function/method defined in the file, however.
>
> I.e. you can work around this by editing a specific method in the class.


Thanks for the response -- after browsing the IPython source
(IPython/Magic.py:magic_edit, line 2060) it's clear to me why it behaves as
it does.  Empty classes aren't handled correctly, but classes with at least
one method in them are (not a big problem, since empty classes are pretty
rare).  As indicated in a comment, the whole magic_edit() method needs some
cleaning up -- if I get some time I'll have a stab at it.

Thanks again,

Kurt





>
>
> --
> Ville M. Vainio
> http://tinyurl.com/vainio
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20090107/8682a8c0/attachment.html 


More information about the IPython-user mailing list