From: Andrea <mar...@go...> - 2009-07-31 14:36:23
|
Hi, I think there is a bug in PyTuple.indexOf() in that it uses the java object as a look up in a List of PyObjects rather than making them comparable first, like "lastIndexOf()" does. class PyTuple .... @Override public int indexOf(Object o) { return getList().indexOf(o); } @Override public int lastIndexOf(Object o) { return getList().lastIndexOf(Py.java2py(o)); } I am in a situation where I pass a jython generated List (which is actually a PyTuple) to a java function, which calls indexOf(). It fails, even if when I extract the objects one by one I can find the correct one. PyTuple.get() correctly extracts the object from the PyObject @Override public Object get(int index) { return array[index].__tojava__(Object.class); } which mirrors the behavior of lastIndexOf(). |