def remove_item(self, index): buf = copy.deepcopy(self.__get_buf()) self.clear_history() for s in buf: readline.add_history(s)