[Python-ideas] tab completion in pdb

stephen emslie stephenemslie at gmail.com
Fri Jan 19 18:08:17 CET 2007


I make frequent use of the python's built-in debugger, which I think is
brilliant in its simplicity. However an important feature seems to be
missing: bash-like tab completion similar to that provided by the
rlcompleter module.

By default, Pdb and other instances of Cmd complete names for commands only.
However in the context of pdb, I think it is more useful to complete
identifiers and keywords in its current scope than to complete names of
commands (most of which have single letter abbreviations). I believe this
makes pdb a far more usable introspection tool.

Implementation:

I've attached a patch to pdb.py (on Python 2.4.4c1). The only real
difference to rlcompleter's default complete method is that because pdb
changes scope as you step through a program, rlcompleter's namespace is
updated to reflect the current local and global namespace.

This is my first attempt at a python patch. Any suggestions or improvements
are welcome.

Stephen Emslie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20070119/4acecaed/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdb-python2.4.4-tabcomplete.patch
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20070119/4acecaed/attachment.bin>


More information about the Python-ideas mailing list