From 2393511b11d2cdc7940ddbf1ebbaa8c4154f84cf Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Wed, 17 Apr 2019 10:02:09 -0700 Subject: [PATCH] Implement __delitem__ --- rbackup/struct/repository.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rbackup/struct/repository.py b/rbackup/struct/repository.py index b0fbfd2..404fc77 100644 --- a/rbackup/struct/repository.py +++ b/rbackup/struct/repository.py @@ -100,9 +100,13 @@ class Repository(Hierarchy): """ return name in self._snapshot_metadata - def __delitem__(self, s): - """Delete a Snapshot in this Repository.""" - raise NotImplementedError + def __delitem__(self, index): + """Delete a Snapshot in this Repository. + + :param index: index of snapshot to delete + :type index: int + """ + del self._snapshots[index] def __getitem__(self, idx): """Retrieve a Snapshot at a certain index."""