[Patches] [ python-Patches-490026 ] Namespace selection for rlcompleter
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 23 Mar 2002 15:45:41 -0800
Patches item #490026, was opened at 2001-12-06 21:42
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=490026&group_id=5470
Category: Library (Lib)
Group: Python 2.3
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Fernando Pérez (fer_perez)
Assigned to: Nobody/Anonymous (nobody)
Summary: Namespace selection for rlcompleter
Initial Comment:
The standard rlcompleter is hardwired to work with
__main__.__dict__. This is limiting, as one may have
applications which execute in specially constructed
'sandboxed' namespaces.
This patch extends rlcompleter with
a constructor which provides an optional namespace specifier.
This optional parameter defaults to __main__.__dict__, so the
patch is 100% backwards compatible.
----------------------------------------------------------------------
>Comment By: Neil Schemenauer (nascheme)
Date: 2002-03-23 23:45
Message:
Logged In: YES
user_id=35752
Looks good. Checked in with minor modifications as
rlcompleter.py 1.10.
----------------------------------------------------------------------
Comment By: Fernando Pérez (fer_perez)
Date: 2001-12-11 18:44
Message:
Logged In: YES
user_id=395388
Updated with a one-line fix (a mistyped variable name). Deleted v2 of the
patch with the typo.
----------------------------------------------------------------------
Comment By: Fernando Pérez (fer_perez)
Date: 2001-12-09 07:16
Message:
Logged In: YES
user_id=395388
I've uploaded a new version of the patch with those changes.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-09 03:32
Message:
Logged In: YES
user_id=6380
Yes, that's about right.
----------------------------------------------------------------------
Comment By: Fernando Pérez (fer_perez)
Date: 2001-12-09 02:53
Message:
Logged In: YES
user_id=395388
I could rewrite it to use instead a namespace=None in the constructor.
If a namespace is given it will be used, otherwise at completion time a
check will be made:
if self.namespace is None:
self.namespace=__main__.__dict__
This means an extra if in the
completer, but would address your concern. Do you want me to do that?
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-09 01:38
Message:
Logged In: YES
user_id=6380
Since this is obviously a new feature, I'll postpone this
until after 2.2.
One thing that worries me: you capture the identity of
__main__.__dict__ early on in this patch. The original code
uses whatever __main__.__dict__ at the time it is needed.
----------------------------------------------------------------------
Comment By: Fernando Pérez (fer_perez)
Date: 2001-12-08 18:39
Message:
Logged In: YES
user_id=395388
Oops, sorry. You can tell I've never used the system before. I put the
file in, but I just didn't see the stupid extra checkbox. Lack of
orthogonality
in an interface is always a recipe for
problems.
Anyway, it should be ok now.
Cheers,
Fernando.
PS.
And the obvious, *THANKS* a lot for putting such a fantastic tool out.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2001-12-08 17:15
Message:
Logged In: YES
user_id=6380
There's no uploaded file! You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file.
Please try again.
(This is a SourceForge annoyance that we can do
nothing about. :-( )
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=490026&group_id=5470