Do not expose __builtins__ name as a completion; this is an implementation
authorFred Drake <fdrake@acm.org>
Wed, 31 May 2000 14:31:00 +0000 (14:31 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 31 May 2000 14:31:00 +0000 (14:31 +0000)
detail that confuses too many people.  Based on discussion in python-dev.

Lib/rlcompleter.py

index aa1dd0246b8019032a65d5c9d8d0f38561f8643e..7a248feff385bb3be62558c84eb94e7df0bb5759 100644 (file)
@@ -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