summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/autocomplete.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/autocomplete.py')
-rw-r--r--Lib/idlelib/autocomplete.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/autocomplete.py b/Lib/idlelib/autocomplete.py
index c623d45..e1e9e17 100644
--- a/Lib/idlelib/autocomplete.py
+++ b/Lib/idlelib/autocomplete.py
@@ -4,6 +4,7 @@ Either on demand or after a user-selected delay after a key character,
pop up a list of candidates.
"""
import __main__
+import keyword
import os
import string
import sys
@@ -171,10 +172,13 @@ class AutoComplete:
(what, mode), {})
else:
if mode == ATTRS:
- if what == "":
+ if what == "": # Main module names.
namespace = {**__main__.__builtins__.__dict__,
**__main__.__dict__}
bigl = eval("dir()", namespace)
+ kwds = (s for s in keyword.kwlist
+ if s not in {'True', 'False', 'None'})
+ bigl.extend(kwds)
bigl.sort()
if "__all__" in bigl:
smalll = sorted(eval("__all__", namespace))