Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
I was also against this feature. My reasons: 1. There will be not much benefit. ascii_alphanumerics is too long, so there is no much saving of typing. There is larger chance of typo. You will be not able to use it for several years, until support of Python 3.10 be dropped, without making the code uglier. 2. What exactly should it include? In virtually all use cases in the stdlib and tests (except two tests) you need a set which contains ascii_letters, digits, and some other characters (usually "_", but sometimes more). Should "_" be included in ascii_alphanumerics? Whatever we choose, it will be less explicit than ascii_letters + digits and people will need to look in the documentations or make errors. And every reader of the code would have doubts. Lib/http/cookies.py:162:_LegalChars = string.ascii_letters + string.digits + "!#$%&'*+-.^_`|~:" Lib/crypt.py:19:_saltchars = _string.ascii_letters + _string.digits + './' Lib/email/_encoded_words.py:75: safe = b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii') Lib/email/quoprimime.py:60:for c in b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii'): Lib/cmd.py:50:IDENTCHARS = string.ascii_letters + string.digits + '_' 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 + "_" Lib/test/test_re.py:1011: LITERAL_CHARS = string.ascii_letters + string.digits + '!"%\',/:;<=>@_`' Lib/test/test_email/test__header_value_parser.py:50: rfc_atext_chars = (string.ascii_letters + string.digits + Lib/test/test_importlib/test_util.py:654: valid_characters = string.ascii_letters + string.digits Lib/test/test_secrets.py:115: legal = string.ascii_letters + string.digits + '-_' Lib/test/string_tests.py:1219: s = string.ascii_letters + string.digits Lib/test/test_shlex.py:328: safeunquoted = string.ascii_letters + string.digits + '@%_-+=:,./' Lib/ntpath.py:359: varchars = bytes(string.ascii_letters + string.digits + '_-', 'ascii') Lib/ntpath.py:370: varchars = string.ascii_letters + string.digits + '_-' Lib/msilib/__init__.py:177: identifier_chars = string.ascii_letters + string.digits + "._" Tools/scripts/texi2html.py:1975:goodchars = string.ascii_letters + string.digits + '!@-=+.' But if other core developers support it, it is okay to me. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45669> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com