diff options
author | Fred Drake <fdrake@acm.org> | 2000-05-31 14:31:00 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-05-31 14:31:00 (GMT) |
commit | 46bd9a6191236c07401169ff407914aeacbddc98 (patch) | |
tree | d7a9da2d14122d48498cd9837fb9d46e1c2c49be | |
parent | 5b8311e3c1e0103aaec24cbc693b634b84e4e0a4 (diff) | |
download | cpython-46bd9a6191236c07401169ff407914aeacbddc98.zip cpython-46bd9a6191236c07401169ff407914aeacbddc98.tar.gz cpython-46bd9a6191236c07401169ff407914aeacbddc98.tar.bz2 |
Do not expose __builtins__ name as a completion; this is an implementation
detail that confuses too many people. Based on discussion in python-dev.
-rw-r--r-- | Lib/rlcompleter.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py index aa1dd02..7a248fe 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 |