mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
Do not expose __builtins__ name as a completion; this is an implementation
detail that confuses too many people. Based on discussion in python-dev.
This commit is contained in:
parent
5b8311e3c1
commit
46bd9a6191
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user