mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-30 14:35:15 +02:00
array list now working with index
This commit is contained in:
parent
81040f4566
commit
ebb919bb8b
1 changed files with 7 additions and 0 deletions
|
|
@ -28,4 +28,11 @@ class ArrayList(list):
|
|||
return True
|
||||
return False
|
||||
|
||||
def index(self, item):
|
||||
index = 0
|
||||
for el in self:
|
||||
if el is item:
|
||||
return index
|
||||
index += 1
|
||||
raise ValueError, "{} is not in list".format(item)
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue