From: Fred Drake Date: Wed, 31 May 2000 14:31:00 +0000 (+0000) Subject: Do not expose __builtins__ name as a completion; this is an implementation X-Git-Tag: v2.0b1~1625 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46bd9a6191236c07401169ff407914aeacbddc98;p=python Do not expose __builtins__ name as a completion; this is an implementation detail that confuses too many people. Based on discussion in python-dev. --- 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