Give UserDict new __contains__ and __iter__ methods.

This commit is contained in:
Tim Peters 2001-04-21 09:13:15 +00:00
parent e99b97e58a
commit a3f98d6bac
2 changed files with 19 additions and 1 deletions

View file

@ -40,3 +40,7 @@ class UserDict:
return self.data[key]
def popitem(self):
return self.data.popitem()
def __contains__(self, key):
return key in self.data
def __iter__(self):
return iter(self.data)