Built-in Functions — Python 3.11.18 documentation
class bytearray(source, encoding, errors). Return a new array of bytes. The bytearray class is a mutable sequence of integers in the range 0 <= x < 256.New in version 3.2: This function was first removed in Python 3.0 and then brought back in Python 3.2.