commit | a3f98d6bac3fbfc0e010360b11793bbd8a8f4c85 | [log] [tgz] |
---|---|---|
author | Tim Peters <tim.peters@gmail.com> | Sat Apr 21 09:13:15 2001 +0000 |
committer | Tim Peters <tim.peters@gmail.com> | Sat Apr 21 09:13:15 2001 +0000 |
tree | 5486edd566e74a59ec25420ad07e79d92b0349d7 | |
parent | e99b97e58a274eb61d7346e786ad242e5253d3db [diff] [blame] |
Give UserDict new __contains__ and __iter__ methods.
diff --git a/Lib/UserDict.py b/Lib/UserDict.py index b642db7..bbd4ca0 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py
@@ -40,3 +40,7 @@ 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)