Code review comment for lp:~ipython-dev/ipython/set_trace

Revision history for this message
Ondrej Certik (ondrej-certik) wrote :

> Hi Ondrej,
>
> sorry for not having worked on this earlier...
>
> What I don't understand is what the point of this feature is, when we already
> have the embedding classes as explained here:
>
> http://ipython.scipy.org/doc/stable/html/interactive/reference.html#embedding
>
> Your code basically reduces the code needed to embed ipython from 3 to 2
> lines, but the existing machinery actually does it with much more flexibility.
> So I'd like to understand the justification for this feature better before
> considering it for merging. Ville's and Jorgen's comments still apply, but
> I'm actually wondering if we need this *at all*. It seems to me that we

Thanks for the suggestion, this oneliner does exactly what I want:

from IPython.Shell import IPShellEmbed; IPShellEmbed()()

The only reason why I devised my line and then contributed a patch is that noone has either replied or suggested anything better so far, up until you.

> already have tools for this, though I may well be missing something and would
> be happy to reconsider.

There is only one thing that I am still missing --- It's really annoying to always type:

from IPython.Shell import IPShellEmbed; IPShellEmbed()()

and it still annoying to type:

import IPython; IPython.ipapi.set_trace()

I would much prefer to just type:

import IPython; IPython.embed()

I use this feature *very* often. Would you consider such a patch?

Ondrej

« Back to merge proposal