summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-09-19 20:29:03 (GMT)
committerTim Peters <tim.peters@gmail.com>2000-09-19 20:29:03 (GMT)
commit7b393fc0379d901da657e8fb870171cca71f94f4 (patch)
treea3b33a94289506ee83fc14a9858a62e77a48fd5d
parent4c799191a2019d21fbeca07ab459751ec857ef0c (diff)
downloadcpython-7b393fc0379d901da657e8fb870171cca71f94f4.zip
cpython-7b393fc0379d901da657e8fb870171cca71f94f4.tar.gz
cpython-7b393fc0379d901da657e8fb870171cca71f94f4.tar.bz2
SF patch 101391: implemented UserList.__contains__.
-rw-r--r--Lib/UserList.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/UserList.py b/Lib/UserList.py
index 1146060..aab5119 100644
--- a/Lib/UserList.py
+++ b/Lib/UserList.py
@@ -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