This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients BTaskaya, corona10, pauloxnet, serhiy.storchaka, skip.montanaro
Date 2021-10-30.13:49:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1635601769.02.0.573900375469.issue45669@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-10-30 13:49:29serhiy.storchakasetrecipients: + serhiy.storchaka, skip.montanaro, corona10, BTaskaya, pauloxnet
2021-10-30 13:49:29serhiy.storchakasetmessageid: <1635601769.02.0.573900375469.issue45669@roundup.psfhosted.org>
2021-10-30 13:49:29serhiy.storchakalinkissue45669 messages
2021-10-30 13:49:28serhiy.storchakacreate