def __init__(self, ids=None, list_size=0): """Initializes the DeviceList object with either IDs or its size.""" ids = [] if ids is None else ids if list_size != 0 and ids == []: Data.__init__(self, [0] * list_size, 'H' * list_size) else: Data.__init__(self, ids, 'H' * len(ids))
def __init__(self, network_id=0): """Initializes the NetworkID object.""" Data.__init__(self, [network_id], 'H') self.id = network_id