SF #754014: list.index() should accept optional start, end arguments

Also, modified UserList.index() to match and expanded the related tests.
This commit is contained in:
Raymond Hettinger 2003-06-17 05:05:49 +00:00
parent c8106e1f1d
commit d05abdec7b
5 changed files with 39 additions and 6 deletions

View file

@ -75,7 +75,7 @@ class UserList:
def pop(self, i=-1): return self.data.pop(i)
def remove(self, item): self.data.remove(item)
def count(self, item): return self.data.count(item)
def index(self, item): return self.data.index(item)
def index(self, item, *args): return self.data.index(item, *args)
def reverse(self): self.data.reverse()
def sort(self, *args): self.data.sort(*args)
def extend(self, other):