bpod_core.misc.ByteEnum
- class bpod_core.misc.ByteEnum
Bases:
IntEnumAn
IntEnumwhose values are single unsigned bytes.Subclass this to define enums with byte-sized values. Each member caches its value as a
bytesobject for zero-allocation wire encoding.Examples
>>> class Color(ByteEnum): ... RED = 1 ... GREEN = 2 >>> Color.RED.as_bytes b'\x01'