class documentation

Base class for flag types

Flags are bitfields in a byte that are set or cleared using dict update notation.

Class Method get Converts bytes -> Flags, splitting the byte into the corresponding bitfields
Class Method set Converts Flags -> bytes, packing the bitfields into the appropriate number of bytes
Method __contains__ Undocumented
Method __gt__ Undocumented
Method __init__ Creates an empty Flags instance with a given initial state and width
Method __int__ Undocumented
Method __str__ Undocumented
Constant _T Undocumented
@classmethod
def get(cls, data: bytes, **kwargs) -> _T: (source)

Converts bytes -> Flags, splitting the byte into the corresponding bitfields

Parameters
data:bytesThe raw bytes to convert
**kwargsUndocumented
Returns
_TA Flags instance with bitfields given by data
@classmethod
def set(cls, value: _T, **kwargs) -> bytes: (source)

Converts Flags -> bytes, packing the bitfields into the appropriate number of bytes

Parameters
value:_TThe value to convert
**kwargsUndocumented
Returns
bytesThe byte string composed of the bitfields given in value
def __contains__(self, bitsets: Mapping[int, int]) -> bool: (source)

Undocumented

def __gt__(self, other) -> bool: (source)

Undocumented

def __init__(self, bitsets: Mapping[int, int] = None, *, width: int = 8): (source)

Creates an empty Flags instance with a given initial state and width

Parameters
bitsets:Mapping[int, int]The initial state of these flags
width:intThe number of bitfields used for these flags (defaults to 8)
def __int__(self) -> int: (source)

Undocumented

def __str__(self) -> str: (source)

Undocumented

Undocumented

Value
'Flags'