Terry J. Reedy <[email protected]> added the comment:
Cheryl said "This looks good" on the PR." while noting that True should not be
added as After trying out REPL completions in macOS Terminal, I *really* want
to be able to type 'im'<tab> and have 'import' appear. (When there is just one
match, it is filled in without displaying a list of one item.) I increasingly
suffer from 'dystypia' (which I coined as the reverse of 'dyslexia'), and
'import' is one of my worst words. And I have to type it daily. On #17238,
Ramchandra Apte also requested completion of 'import'.
Sorting keywords by length, we get:
>>> sorted(keyword.kwlist, key=lambda s: len(s))
['as', 'if', 'in', 'is', 'or', 'and', 'def', 'del', 'for', 'not', 'try',
'None', 'True', 'elif', 'else', 'from', 'pass', 'with', 'False', 'async',
'await', 'break', 'class', 'raise', 'while', 'yield', 'assert', 'except',
'global', 'import', 'lambda', 'return', 'finally', 'continue', 'nonlocal',
'__peg_parser__']
I agree that adding 2 and 3 letter keywords is not useful. Among 4 letter
keywords, None and True are already present from builtins. 'elif' and 'else'
would need at least 3 and 4 keystrokes to complete ('e', <Tab>, Down for
'else', <Enter>). 'from' would need at least 4 because of 'filter' and
'frozenset'. 'pass' would need 3 because of 'pow'. 'with' would require at
least 5 if 'while' were added. So skip length 4 keywords also.
So I am changing the proposal to adding the 17 keywords (other than False,
already present) of length 5 or more. These include 'async' and 'await',
requested by Karthikeyan in the opening post above.
----------
title: IDLE: Include keywords in __main__ autocomplete list -> IDLE: Include
'long' keywords in __main__ autocomplete list
versions: +Python 3.10 -Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37765>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com