Implement UserDict.__contains__() and __iter__(). (trunk r12630)
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:45:06 +0000 (05:45 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 05:45:06 +0000 (05:45 -0000)
svn path=/main/branches/2.1.6/; revision=12903

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)