def dbset(self, name, value):
    self.transaction.append((name, self.database.get(name)))
self.database[name] = value

def rollback(self):
    while self.transaction:
        pass
python database implementation