Hello everyone,
i have the following problem:
I would like to get a list of Python objects which are provided by a Python method. This method is called in Java via a PyCallable. However, it seems that I only get back an ArrayList of strings, but not of the type PyObject. Does anyone have an idea what I am doing wrong here? :)
Example Code:
ArrayList<PyObject> list = function.callAs(ArrayList.class);
System.out.println(list.getClass());
System.out.println(list.get(0).getClass());
Output:
class java.util.ArrayList
Exception in thread "main" java.lang.ClassCastException: class java.lang.String cannot be cast to class jep.python.PyObject
Best regards
Chris