Author terry.reedy
Recipients taleinat, terry.reedy, xtreak
Date 2019-08-05.20:16:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565036166.88.0.535707919401.issue37765@roundup.psfhosted.org>
In-reply-to
Content
If keywords are included when the REPL has tab completions (which Windows doesn't), then it is plausible that IDLE should.  It could be considered part of 'Shell should (mostly) imitate REPL'.  But I can see Tal's point, though the relative expansion is pretty small.  And there is nothing on the master completions issue #27609 where I collected known not-yet-rejected suggestions and ideas.

The implementation is trivial.  Add two new lines to autocomplete.py.  So you can easily patch a private copy.  I am preparing a minimal PR.

import keyword  # add
...
    def fetch_completions(self, what, mode):
...
                    bigl = eval("dir()", namespace)
                    bigl.extend(keyword.kwlist)  # add
                    bigl.sort()

True, False, and None are also in builtins, so cannot serve as a test.
---

A separate idea: annotate completion list, at least as an option, with 'keyword' or class, possibly prefixed with 'built-in', so 'built-in function', 'function', and so on.
History
Date User Action Args
2019-08-05 20:16:06terry.reedysetrecipients: + terry.reedy, taleinat, xtreak
2019-08-05 20:16:06terry.reedysetmessageid: <1565036166.88.0.535707919401.issue37765@roundup.psfhosted.org>
2019-08-05 20:16:06terry.reedylinkissue37765 messages
2019-08-05 20:16:06terry.reedycreate