From: Zac Medico Date: Wed, 7 Sep 2011 15:56:15 +0000 (-0700) Subject: cache/volatile: fix __iter__ and __contains__ X-Git-Tag: v2.2.0_alpha55~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f55f1714c7e2855ca4cbb45f9d8ae6cee126af17;p=portage.git cache/volatile: fix __iter__ and __contains__ Special methods can't be assigned in the constructor. --- 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