From 4a90568a98a0698bb2cad57b8e17effb7abaa124 Mon Sep 17 00:00:00 2001 From: Petr Šplíchal Date: Thu, 16 Feb 2012 13:18:45 +0100 Subject: New method clear() for cleaning containers --- source/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/api.py b/source/api.py index c0792f5..7fbf1c7 100644 --- a/source/api.py +++ b/source/api.py @@ -1404,6 +1404,10 @@ class Container(Mutable): else: self._update() + def clear(self): + """ Remove all items from the container. """ + self.remove(list(self._items)) + def _add(self, items): """ Add provided items to the server. """ raise NitrateError("To be implemented by respective class.") -- cgit