[plum.bytearray] Module Reference

Interpret bytes as a byte array.

class plum.bytearray.ByteArray

Interpret bytes as a byte array.

ByteArray(iterable_of_ints) -> bytes array
ByteArray(string, encoding[, errors]) -> bytes array
ByteArray(bytes_or_buffer) -> mutable copy of bytes_or_buffer
ByteArray(int) -> bytes array of size given by the parameter initialized with null bytes
ByteArray() -> empty bytes array
class plum.bytearray.ByteArrayType

ByteArray type metaclass.

Create custom ByteArray subclass. For example:

>>> from plum.bytearray import ByteArray
>>> class ByteArray1(ByteArray, nbytes=4):
...     pass
...
>>>
Parameters:
  • nbytes (int) – size in number of bytes
  • fill (int) – default value to fill unspecified bytes