def SetData(self, cols, data):
    for idx, row in enumerate(data):
        item = dict((k, v.rstrip() if hasattr(v, 'rstrip') else v) for k, v in
            zip(cols, row))
self.data[idx] = item
self.byid[row[0]] = item
Access a dictionary as a list