[IPython-dev] making %pydb be more pythonic (was: Extensions/pydb_ipy.py added)

R. Bernstein rocky at panix.com
Wed Nov 22 22:04:52 CST 2006


About a month back, there was this discussion:

R. Bernstein writes:
 > Ville M. Vainio writes:
 >  > On 10/28/06, R. Bernstein <rocky at panix.com> wrote:
 >  > 
 >  > > But one other thing regarding call_pydb(). And I'm not really sure how
 >  > > to fix. So if anyone has suggestions...
 >  > >
 >  > > pydb.runv() should be using the ipython Pdb class which has pdef, pdoc
 >  > > commands added and not the pydb one.
 >  > 
 >  > Would it make sense to import pydb.pydb module in pydb_ipy.py, and
 >  > inject the ipython version of Pdb class to the pydb module namespace?
 >  > That way main() would instantiate the ipython version...
 > 
 > Good idea! That's be great!

Nothing has happened on this and I suspect because it wasn't
doable. (At least I couldn't figure out how it would be done. But I
figured if it could that *could* it would be a great thing to do.)

So recently, I've added a parameter to pydb so that runv() can get
passed with an Pdb object extended in the way that ipython wants to
extend it. That will be in the next release of pydb (which again can
be timed so that it is no later than the next ipython release).

I've modified ipy_pydb.py so that it now passes in such a Pdb
object. This was the debug session can make use of pdoc and pinfo. It
also uses the ipython debugger prompt (which personally I'm not a fan
of but I guess it makes it ipython consistent.) There is now the
possibility of using the ipython color scheme, but I couldn't figure
out how to get that passed when creating the Debugger.Pdb object.

And in going over IPython/Extensions/ipy_pydb.py I've noticed a couple
of other things. First there should be a check that pydb can be
imported and that there is a late enough version of pydb. 

Below is a patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipy_pydb.py.diff
Type: application/octet-stream
Size: 1184 bytes
Desc: Changes to have %pydb be more ipythonic.
Url : http://projects.scipy.org/pipermail/ipython-dev/attachments/20061122/fbb35919/attachment.obj 


More information about the IPython-dev mailing list