Message5540
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 |
|
Date |
User |
Action |
Args |
2010-02-17 20:47:10 | MrMeanie | set | recipients:
+ MrMeanie |
2010-02-17 20:47:10 | MrMeanie | set | messageid: <1266439630.62.0.704450853246.issue1558@psf.upfronthosting.co.za> |
2010-02-17 20:47:10 | MrMeanie | link | issue1558 messages |
2010-02-17 20:47:09 | MrMeanie | create | |
|