mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF patch 101391: implemented UserList.__contains__.
This commit is contained in:
parent
4c799191a2
commit
7b393fc037
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue