Message12406
It would be nice in Java 8 onward if Python functions could be used where functional interfaces specified by lambdas (or method refs) can be used in Java.
Examples would be in streams e.g.
filtered_list = al.stream().filter(moreThanThree).collect(toList())
See attached example for full code.
This fails at them moment because although Predicate is a @FunctionalInterface it also declares default methods. which results in it not being coerced in PyFunction.__tojava__(Class<?>)
Probably for after 2.7.1 it might be easier to implement when default methods can be introspected via reflection. |
|
Date |
User |
Action |
Args |
2019-03-27 20:14:11 | jamesmudd | set | recipients:
+ jamesmudd |
2019-03-27 20:14:11 | jamesmudd | set | messageid: <1553717651.98.0.00883112300131.issue2752@roundup.psfhosted.org> |
2019-03-27 20:14:11 | jamesmudd | link | issue2752 messages |
2019-03-27 20:14:11 | jamesmudd | create | |
|