Replies: 1 comment
-
Isn't this already integrated. Java funtions are Python methods. If referenced from an object they are bound methods. Methods and bound methods automatically cast to FunctionalInterface. Thus the code above is exactly as you showed in Python. If you want a typed funtional use the @ operator. func = (IntSupplier)@ a.func1 Note a::func1 is a.func1 not A.func1. Type::func is an unbound method that takes the hidden this as first argument. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I wonder if there is any, or planned, or workaround, for referencing Java methods. For example, we would like to do (in Python):
where a and b are JPype Java objects and func1 is a method on the Java object. b.setFunction() takes a Java lambda. In Java it would look like:
Beta Was this translation helpful? Give feedback.
All reactions