]> granicus.if.org Git - python/commitdiff
SF patch 101391: implemented UserList.__contains__.
authorTim Peters <tim.peters@gmail.com>
Tue, 19 Sep 2000 20:29:03 +0000 (20:29 +0000)
committerTim Peters <tim.peters@gmail.com>
Tue, 19 Sep 2000 20:29:03 +0000 (20:29 +0000)
Lib/UserList.py

index 114606098ce09337551b9de508af8be2aaad926a..aab511915ccc2a707b84fd09d39ecef9531a6e4c 100644 (file)
@@ -17,6 +17,7 @@ class UserList:
             return cmp(self.data, other.data)
         else:
             return cmp(self.data, other)
+    def __contains__(self, item): return item in self.data
     def __len__(self): return len(self.data)
     def __getitem__(self, i): return self.data[i]
     def __setitem__(self, i, item): self.data[i] = item