New submission from Terry J. Reedy <tjre...@udel.edu>:

IDLE currently defines the same set of chars in 5 places with 5 names. (Listed 
by Serhiy Storchaka in #45669.)
Lib/idlelib/autoexpand.py:20:    wordchars = string.ascii_letters + 
string.digits + "_"
Lib/idlelib/undo.py:254:    alphanumeric = string.ascii_letters + string.digits 
+ "_"
Lib/idlelib/editor.py:809:    IDENTCHARS = string.ascii_letters + string.digits 
+ "_"
Lib/idlelib/hyperparser.py:13:_ASCII_ID_CHARS = frozenset(string.ascii_letters 
+ string.digits + "_")
Lib/idlelib/autocomplete.py:33:ID_CHARS = string.ascii_letters + string.digits 
+ "_"

I suspect that either a string or frozenset would work everywhere (check).  I 
will pick a name after checking this.  The single definition would go in the 
proposed utils.py, which is part of another issue and PR.

(Note: the utility tk index functions should also go there.)

----------
assignee: terry.reedy
components: IDLE
messages: 405516
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: define word/id chars in one place.
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45692>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to