Message12406

Author jamesmudd
Recipients jamesmudd
Date 2019-03-27.20:14:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1553717651.98.0.00883112300131.issue2752@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-03-27 20:14:11jamesmuddsetrecipients: + jamesmudd
2019-03-27 20:14:11jamesmuddsetmessageid: <1553717651.98.0.00883112300131.issue2752@roundup.psfhosted.org>
2019-03-27 20:14:11jamesmuddlinkissue2752 messages
2019-03-27 20:14:11jamesmuddcreate