def save(self, filename=None):
        filename = Path(filename) if filename is not None else self.filename
        with filename.open("w") as f:
            f.write(self.yaml)
def reorder_item(self, item, position):
    new_position = min(max(position, 0), len(self._items) - 1)