class documentation

class tagWithL: (source)

Constructor: tagWithL.unpack(data)

View In Hierarchy

Represents a tag with rail information and version.

Class Method unpack Unpacks a bytes sequence into a tagWithL object.
Method pack Packs the tagWithL object into a bytes sequence.
Class Variable is_with_rail Undocumented
Class Variable version Undocumented
def unpack(cls, data: bytes) -> tagWithL: (source)

Unpacks a bytes sequence into a tagWithL object.

Parameters
data:bytesThe bytes to unpack, expected to be 2 bytes.
Returns
tagWithLA tagWithL object.
Raises
struct.errorIf the input bytes are not the expected size (2 bytes).
ValueErrorIf the unpacked version value does not correspond to a valid tagVersionRail enum member.
def pack(self) -> bytes: (source)

Packs the tagWithL object into a bytes sequence.

Packs a boolean (as a byte) and the version value (as a byte) into a byte string. Uses little-endian byte order.

Returns
bytesA bytes object representing the packed data (2 bytes).
is_with_rail: bool = (source)

Undocumented

Undocumented