From ebb919bb8b99f708d76b7a0d0bd5a53eb9627add Mon Sep 17 00:00:00 2001 From: mzwiessele Date: Wed, 26 Mar 2014 14:59:08 +0000 Subject: [PATCH] array list now working with index --- GPy/core/parameterization/lists_and_dicts.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GPy/core/parameterization/lists_and_dicts.py b/GPy/core/parameterization/lists_and_dicts.py index ca0589c9..31235952 100644 --- a/GPy/core/parameterization/lists_and_dicts.py +++ b/GPy/core/parameterization/lists_and_dicts.py @@ -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