[IPython-user] Question re Subtle Diff between Embed and Breakpoint
Tue Jun 3 00:57:16 CDT 2008
[ another long-lost question I just found...]
On Wed, Jul 4, 2007 at 4:27 AM, Jeff Rush <firstname.lastname@example.org> wrote:
> Hi, I'm preparing a presentation on the features of IPython and I'm stuck on
> one question.
> What is the difference (in capability) between:
> dropping into an IPShellEmbed(), poking some vars and then
> exiting the shell to let the program continue executing,
> setting a breakpoint using pdb at that same point, poking
> some vars and letting it continue running,
> enabling IPython's feature of sending uncaught exceptions
> into the debugger, placing an exception at that same code
> point, and upon hitting the exception, poking at some vars,
> I guess in this cast I cannot continue running though since
> Python exceptions are not recoverable.
> There seems to be a very subtle difference and I want to convey it accurately
> in my presentation (actually a screencast).
Mmh, this reply is definitely way late, since your screencast is
probably long done. But for the record...
1. You get a full ipython shell, no questions asked. This
instantiates effectively the entire ipython engine.
2. You get a pdb instance. A while ago this didn't even have tab
completion, so it was rather painful to use. Now it does have that
and a bit more goodies, but you're still inside pdb. No magics, no os
access, and more importantly, the pdb commands all work (c, n, s,
etc.) for better or worse (the worse part is when one such command
inadvertedly pops you out of pdb when you thought you were just
printing a variable with that name).
3. As you said. It's basically like 2, except the code is dead and
you are just analyzing a static stack, instead of running an active
program whose execution you can control, stop, continue, etc.
Sorry again this one fell through the cracks...
More information about the IPython-user