'Set the packet payload.  Expects bytes or a packet_base subclass.'

def set_payload(self, payload):

    if isinstance(payload, packet_base):
        self.next = payload
        payload.prev = self
    elif (type(payload) == bytes):
        self.next = payload
    else:
        raise TypeError('payload    must    be    string    or    packet    subclass')
