'Add data to this QR Code.
:param optimize: Data will be split into multiple chunks to optimize
the QR size by finding to more compressed modes of at least this
length. Set to ``0`` to avoid optimizing at all.'

def add_data(self, data, optimize=20):

    if isinstance(data, util.QRData):
        self.data_list.append(data)
    elif optimize:
        self.data_list.extend(util.optimal_data_chunks(data))
    else:
        self.data_list.append(util.QRData(data))
    self.data_cache = None
