Tal Einat added the comment:
AutoComplete isn't doing hidden checks. My concern is that auto-completion
happens automatically and the parsing is done synchronously, so if the parsing
takes a significant amount of time it can cause a delay long enough to be
noticeable by users. We should also consider the IDLE is being used on some
relatively weak computers, such as Raspberry Pi. I have one for testing if
needed!
Your suggestion of jumping backwards several characters at a time and calling
isidentifier() seems problematic. For example, how would it deal with something
like "2fast2furious"? Recognizing "fast2furious" as the identifier candidate is
incorrect, but that's what we'd get with a straightforward implementation of
your suggestion. I can't think of a way to get this right without be able to
check if each character is valid for identifiers.
I still think the category(normalize(char)[0]) in {...} approach could be just
fine. I'd really like to get feedback from an expert on unicode. The experts
index lists three people as experts on unicodedata; I've added them to the nosy
for this issue.
Once we have an identifier candidate, the code currently just checks that the
first char is valid and that the identifier isn't a keyword. We probably should
use str.isidentifier() instead of just checking the first character.
----------
nosy: +ezio.melotti, lemburg, loewis
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21765>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com