Implement UserDict.__contains__() and __iter__().
authorZac Medico <zmedico@gentoo.org>
Thu, 19 Feb 2009 03:34:05 +0000 (03:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 19 Feb 2009 03:34:05 +0000 (03:34 -0000)
svn path=/main/trunk/; revision=12630

pym/portage/cache/mappings.py

index a368050bacae73aad30fec0ea5cd9ba9dfa5ac78..a767e1bc5c80cef2e33b6aa0da35d0469ab32a8b 100644 (file)
@@ -144,6 +144,12 @@ class UserDict(MutableMapping):
        def __repr__(self):
                return repr(self.data)
 
+       def __contains__(self, key):
+               return key in self.data
+
+       def __iter__(self):
+               return iter(self.data)
+
        def __len__(self):
                return len(self.data)