Package jep

Annotation Interface PyMethod


@Retention(RUNTIME) @Target({METHOD,CONSTRUCTOR}) public @interface PyMethod
Can be used with a method or constructor to customize the behavior of Jep when the method is called from Python.
Since:
4.2
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Set to true to indicate that this Java method should accept keyword arguments when it is called from Python.
    boolean
    Set to true to indicate that this Java method should accept varargs when it is called from Python.
  • Element Details

    • varargs

      boolean varargs
      Set to true to indicate that this Java method should accept varargs when it is called from Python. This is not necessary for Objects which use Java style varargs, Jep automatically maps Python varargs to java varargs. The last argument(or second to last argument if kwargs is also true) must be a type that is compatible with a Python tuple, such as a List, array, or PyObject. If the argument is an array of a specific type then jep will attempt to convert all varargs to that type and throw an exception if conversion is not defined.
      Default:
      false
    • kwargs

      boolean kwargs
      Set to true to indicate that this Java method should accept keyword arguments when it is called from Python. The last argument must be a type that is compatible with a Jep dict, such as a Map or PyObject.
      Default:
      false