[IPython-dev] Why does Debugger.Pdb inherit from bdb.Bdb, cmd.Cmd?

Fernando Perez Fernando.Perez at colorado.edu
Sun May 22 14:40:18 CDT 2005


Tom Locke wrote:
> Hi,
> 
> I'm writing a custom Python debugger. The base class will either be 
> pdb.Pdb or IPython.Debugger.Pdb if that is available.
> 
> I noticed that IPython .Pdb inherits from dbd.Bdb and cmd.Cmd directly, 
> despite the fact that pdb.Pdb already does so. I don't understand why, 
> so I just wanted to ask in case I'm missing something important.
> 
> I realise Debugger.Pdb.__init__ cannot call pdb.Pdb.__init__ directly, 
> as it needs to pass completekey=None to Cmd.__init__, but I don't see 
> why it can't just have pdb.Pdb as its single base class.
> 
> Am I missing something?

Nope, nothing.  In fact, it was probably just carelessness on my part, I just 
fixed it to read:

class Pdb(pdb.Pdb):
     """Modified Pdb class, does not load readline."""


and I can't see any ill effects.  This will go into the .14 bugfix (a few days 
out)

Thanks for pointing this out.

Cheers,

f




More information about the IPython-dev mailing list