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

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

> > Thanks for the suggestion, this oneliner does exactly what I want:
> >
> > from IPython.Shell import IPShellEmbed; IPShellEmbed()()
> >
>
> Thanks for catching this Fernando. Until recently, I haven't been very
> familiar with our embedding code.
>
>
> > 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()
> >
>
> What would that do? I

From the user perspective it would be exactly equivalent to:

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

> > I use this feature *very* often. Would you consider such a patch?
> >
>
> If it simplifies embedding, then yes, I think we would consider it. But, it
> should go into Shell.py, which I have just refactored for the 0.11 release
> (won't go into 0.10). Are you OK waiting for the 0.11 for this - it will be
> much cleaner to implement then.

Sure, I can move it whenever is the best and sure I can wait for 0.11. Are you ok with me adding a stub into the __init__.py, so that this can be invoked just by:

import IPython; IPython.embed()

?

Ondrej

« Back to merge proposal