Skip to content

The doc of bytes.isalnum() and bytearray.isalnum() should say alphabetic ASCII characters and/or ASCII decimal digits #137267

@hyperkai

Description

@hyperkai

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

No one assigned

    Labels

    docsDocumentation in the Doc dirpendingThe issue will be closed if no feedback is provided

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions