-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-89855: Improve support of non-ASCII identifiers in IDLE #29381
base: main
Are you sure you want to change the base?
gh-89855: Improve support of non-ASCII identifiers in IDLE #29381
Conversation
serhiy-storchaka
commented
Nov 3, 2021
•
edited by terryjreedy
Loading
edited by terryjreedy
- Issue: IDLE: define word/id chars in one place. #89855
It is a draft. Needed tests. |
@@ -14,13 +14,6 @@ | |||
# all ASCII chars that may be the first char of an identifier | |||
_ASCII_ID_FIRST_CHARS = frozenset(string.ascii_letters + "_") | |||
|
|||
# lookup table for whether 7-bit ASCII chars are valid in a Python identifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_IS_ASCII_ID_CHAR[ord(c)]
is slower than c in _ASCII_ID_CHARS
.
while i > 0 and line[i-1] in self.wordchars: | ||
i = i-1 | ||
return line[i:] | ||
m = _LAST_WORD_RE.search(line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to test with long lines.
This PR is stale because it has been open for 30 days with no activity. |
This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today. |