all Python 3Byte sequencesfunction
bytearray.isupper
bytearray — is* checks
All cased bytes are upper-case.
Syntax
ba.isupper(...)
At least one cased byte is required: b'123' and an empty bytearray both give False even though they contain no lower-case letters. Also, isupper() being False does not make islower() True — b'Ab1' fails both, so "not upper-case" and "lower-case" are different questions.
Examples
print(bytearray(b'ABC').isupper()) # → True
print(bytearray(b'ABC1!').isupper()) # → True
print(bytearray(b'Abc').isupper()) # → False
print(bytearray(b'123').isupper()) # → False
print(bytearray(b'').isupper()) # → False
See also
Open in the full glossarydocs.python.orgReport an inaccuracy