Message5540

Author MrMeanie
Recipients MrMeanie
Date 2010-02-17.20:47:08
SpamBayes Score 9.650193e-06
Marked as misclassified No
Message-id <1266439630.62.0.704450853246.issue1558@psf.upfronthosting.co.za>
In-reply-to
Content
A Python function can be passed as a parameter to a Java method, where the corresponding argument is a single method interface. This is accomplished by having PyFunction.__tojava__ perform the conversion/wrapping.
While the resulting wrapped PyFunction works properly when the interface method is invoked, it malfunctions if the Java code attempts to access a method those defined in java.lang.Object, hashCode() or toString() for example.
I believe others have run into this difficulty.

I believe others have discovered that this can block the use of method specifically coded to accept PyFunctions or PyObjects - for example, given the two java methods:

void myMethod(PyFunction x);
void myMethod(SingleMethodInterface x);

The PyFunction.__tojava__() modification would result in the second method being chosen over the first, despite the fact that the first may be desirable.


Many Thanks.

Regards

Geoffrey French
History
Date User Action Args
2010-02-17 20:47:10MrMeaniesetrecipients: + MrMeanie
2010-02-17 20:47:10MrMeaniesetmessageid: <1266439630.62.0.704450853246.issue1558@psf.upfronthosting.co.za>
2010-02-17 20:47:10MrMeanielinkissue1558 messages
2010-02-17 20:47:09MrMeaniecreate