-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
Description
The doc of bytes.isalnum() and bytearray.isalnum() says alphabetical ASCII characters or ASCII decimal digits
as shown below:
Return
True
if all bytes in the sequence are alphabetical ASCII characters or ASCII decimal digits and the sequence is not empty,False
otherwise. Alphabetic ASCII characters are those byte values in the sequence ...
But bytes.isalnum()
and bytearray.isalnum()
work for alphabetical ASCII characters and/or ASCII decimal digits as shown below and actually, the word alphabetical
which isn't proper should be replaced with alphabetic
:
print(b'abc123'.isalnum())
print(b'abc'.isalnum())
print(b'123'.isalnum())
print(bytearray(b'abc123').isalnum())
print(bytearray(b'abc').isalnum())
print(bytearray(b'123').isalnum())
# True
print(b'a b c 1 2 3'.isalnum())
print(b'a b c'.isalnum())
print(b'1 2 3'.isalnum())
print(bytearray(b'a b c 1 2 3').isalnum())
print(bytearray(b'a b c').isalnum())
print(bytearray(b'1 2 3').isalnum())
# False
So, the doc of bytes.isalnum()
and bytearray.isalnum()
should say alphabetic ASCII characters and/or ASCII decimal digits
as shown below:
Return
True
if all bytes in the sequence are alphabetic ASCII characters and/or ASCII decimal digits and the sequence is not empty,False
otherwise. Alphabetic ASCII characters are those byte values in the sequence ...
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status