bpod_core.com.ByteLike

bpod_core.com.ByteLike: TypeAlias = collections.abc.Buffer | int | numpy.ndarray | numpy.generic | str | collections.abc.Iterable['ByteLike']

A recursive type alias representing any data that can be converted to bytes for serial communication.

Includes:

  • Buffer: Any buffer-compatible object (e.g., bytes, bytearray, memoryview)

  • int: Single integer values (interpreted as a single byte)

  • np.ndarray, np.generic: NumPy arrays and scalars (converted via .tobytes())

  • str: Strings (encoded as UTF-8)

  • Iterable[‘ByteLike’]: Nested iterables of ByteLike types (recursively flattened)