Console autocompletion doubled variants for True, False, None (PY-26482)

Completion elements are duplicated because these built-in constants are added to builtin dict and also added again like keywords.
This commit is contained in:
Elizaveta Shashkova
2018-03-28 17:56:28 +03:00
parent c7d3bf089e
commit 8f13aefa23
@@ -15,6 +15,7 @@ except ImportError:
from _pydev_bundle import _pydev_imports_tipper
from _pydevd_bundle import pydevd_xml
from _pydevd_bundle.pydevd_constants import dict_iter_items
dir2 = _pydev_imports_tipper.generate_imports_tip_for_module
@@ -105,7 +106,13 @@ class Completer:
a = {}
for dict_with_comps in [__builtin__.__dict__, self.namespace, self.global_namespace]: #@UndefinedVariable
filtered_builtin = {}
for (key, val) in dict_iter_items(__builtin__.__dict__):
# do not use dict comprehension for Py2.6 compatibility
if val not in (True, False, None):
filtered_builtin[key] = val
for dict_with_comps in [filtered_builtin, self.namespace, self.global_namespace]: #@UndefinedVariable
a.update(dict_with_comps)
filter = _StartsWithFilter(text)