From: John G. <jgo...@co...> - 2001-11-08 19:19:28
|
bc...@wo... (Finn Bock) writes: > The return value from PythonInterpreter.get() is always a PyObject > instance. You need to explicit convert the returned PyObject instance to > an instance of your java class like this: There are two PythonInterpeter.get() methods; one of which takes two parameters (the second the Java class to convert to) and returns a java.lang.Object. It is my understanding that this is equivolent to the code you showed. I was using this one, and got the mentioned error. > > Object tmp = interp.get("cl").__tojava__(ListBO.class); > if (tmp != Py.NoConversion) { > ListBO newobj = (ListBO) tmp; > } > > If the "cl" variable can't be converted to a ListBO, the constant value > of Py.NoConversion is returned. > > regards, > finn -- John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org |