From f55f1714c7e2855ca4cbb45f9d8ae6cee126af17 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 7 Sep 2011 08:56:15 -0700 Subject: [PATCH] cache/volatile: fix __iter__ and __contains__ Special methods can't be assigned in the constructor. --- pym/portage/cache/volatile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pym/portage/cache/volatile.py b/pym/portage/cache/volatile.py index 0bf6bab2c..18049dddb 100644 --- a/pym/portage/cache/volatile.py +++ b/pym/portage/cache/volatile.py @@ -14,12 +14,16 @@ class database(template.database): config.pop("perms", None) super(database, self).__init__(*args, **config) self._data = {} - self.__iter__ = self._data.__iter__ self._delitem = self._data.__delitem__ - self.__contains__ = self._data.__contains__ def _setitem(self, name, values): self._data[name] = copy.deepcopy(values) def _getitem(self, cpv): return copy.deepcopy(self._data[cpv]) + + def __iter__(self): + return iter(self._data) + + def __contains__(self, key): + return key in self._data -- 2.26.2