Skip to content

gh-89855: Improve support of non-ASCII identifiers in IDLE#29381

Draft
serhiy-storchaka wants to merge 2 commits intopython:mainfrom
serhiy-storchaka:idle-nonascii-identifiers
Draft

gh-89855: Improve support of non-ASCII identifiers in IDLE#29381
serhiy-storchaka wants to merge 2 commits intopython:mainfrom
serhiy-storchaka:idle-nonascii-identifiers

Conversation

@serhiy-storchaka
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka commented Nov 3, 2021

@serhiy-storchaka
Copy link
Copy Markdown
Member Author

It is a draft. Needed tests.

# 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
Copy link
Copy Markdown
Member Author

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)
Copy link
Copy Markdown
Member Author

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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 4, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Dec 4, 2021
@ambv
Copy link
Copy Markdown
Contributor

ambv commented May 17, 2022

This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today.

@terryjreedy terryjreedy changed the title bpo-45692: Improve support of non-ASCII identifiers in IDLE gh-89855: Improve support of non-ASCII identifiers in IDLE Sep 18, 2022
@hugovk hugovk removed the needs backport to 3.10 only security fixes label Apr 7, 2023
@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes and removed needs backport to 3.11 only security fixes labels May 9, 2024
@tomasr8 tomasr8 removed the needs backport to 3.12 only security fixes label Apr 10, 2025
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes stale Stale PR or inactive for long period of time. type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants