Class PythonFunction<T>

java.lang.Object
com.illumon.integrations.python.PythonFunction<T>
Type Parameters:
T - input argument class
All Implemented Interfaces:
Function<T,Object>

@ScriptApi public class PythonFunction<T> extends Object implements Function<T,Object>
A Function implementation which calls a Python callable.
  • Constructor Details

    • PythonFunction

      public PythonFunction(org.jpy.PyObject pyObjectIn, Class classOut)
      Creates a Function which calls a Python function.
      Parameters:
      pyObjectIn - the python object providing the function - must either be callable or have an `apply` attribute which is callable.
      classOut - the specific java class to interpret the return for the method. Note that this is probably only really useful if `classOut` is one of String, double, float, long, int, short, byte, or boolean. Otherwise, the return element will likely just remain PyObject, and not be particularly usable inside Java.
  • Method Details