-
-
Save kevinherron/c385f90afc6f0dd3c9cf to your computer and use it in GitHub Desktop.
PyReflectedFunction Fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReflectedFunction extends PyReflectedFunction { | |
private final PyObject self; | |
/** | |
* Constructor for use with a static Java method. | |
* | |
* @param m | |
* A static Java method. | |
*/ | |
public ReflectedFunction(Method m) { | |
this(m, new Object()); | |
} | |
/** | |
* Constructor for use with an instance Java method. | |
* | |
* @param m | |
* An instance Java method. | |
* @param self | |
* The instance the method belongs to. | |
**/ | |
public ReflectedFunction(Method m, Object self) { | |
super(m); | |
this.self = PyJavaType.wrapJavaObject(self); | |
} | |
@Override | |
public PyObject __call__(PyObject[] args, String[] keywords) { | |
return __call__(self, args, keywords); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment