[Patches] [ python-Patches-677719 ] improved readline usage in pdb

SourceForge.net noreply@sourceforge.net
Thu, 30 Jan 2003 12:33:50 -0800


Patches item #677719, was opened at 2003-01-30 20:33
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=677719&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Stone (mbrierst)
Assigned to: Nobody/Anonymous (nobody)
Summary: improved readline usage in pdb

Initial Comment:

Adds tab-completion of locals and globals in the scope of the code being executed by pdb from the (Pdb) prompt.

patchrlcomplete:
* adds a local namespace to the arguments of Completer's constructor.  Necessary to evaluate local objects correctly when doing completion.  Defaults to None so backwards compatibility should be fine.
* No longer always loads the Completer on import.  Only loads it when a completer has not been assigned.  This is better if someone has previously loaded a completer they don't want changed.  Without this the pdb completer would have to save the old completer before importing the rlcompleter module to avoid the undesired side effect of pdb changing the completion function.
* removes words.append('__class__') as it should already be included.  I'm not sure if there's a good reason for this line.  It was originally written by Michael Hudson I believe, perhaps he knows if there is someplace this does something?  (this has nothing to do with the main work of this patch)
* allows __builtins__ to be completed like anything else.  Why not?  Sometimes I want to look at __builtins__.  Is there a reason not to allow it to be completed?  (again, nothing to do with the main patch)

patchpdb:
* complete method overrides Cmd's complete method.  Gives all completions from Cmd.complete followed by completions from rl_completer.

Let me know what you think of it (the idea and the implementation).  If you don't want my small irrelevant changes to rlcompleter, I can get rid of them.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=677719&group_id=5470