summaryrefslogtreecommitdiff
path: root/Lib/rlcompleter.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-05-31 14:31:00 +0000
committerFred Drake <fdrake@acm.org>2000-05-31 14:31:00 +0000
commit392d8dc818b11fea705e2836b0efff657b1ddd23 (patch)
treec80e4ca9d587b059dbac7adb1f874faa3287c0fc /Lib/rlcompleter.py
parentbbb07f01a36886a9aa8db57fa969d721cf46df9f (diff)
downloadcpython-392d8dc818b11fea705e2836b0efff657b1ddd23.tar.gz
Do not expose __builtins__ name as a completion; this is an implementation
detail that confuses too many people. Based on discussion in python-dev.
Diffstat (limited to 'Lib/rlcompleter.py')
-rw-r--r--Lib/rlcompleter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index aa1dd0246b..7a248feff3 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -76,7 +76,7 @@ class Completer:
__builtin__.__dict__.keys(),
__main__.__dict__.keys()]:
for word in list:
- if word[:n] == text:
+ if word[:n] == text and word != "__builtins__":
matches.append(word)
return matches
@@ -106,7 +106,7 @@ class Completer:
matches = []
n = len(attr)
for word in words:
- if word[:n] == attr:
+ if word[:n] == attr and word != "__builtins__":
matches.append("%s.%s" % (expr, word))
return matches