jpython +java module problem

Douglas du Boulay ddb at crystal.uwa.edu.au
Mon Jun 12 02:00:54 EDT 2000


Hi, 
I have tried to write a small java class (myclass), subclassing
PyObject, 
intended to be used within jpython, where all the java class 
methods take PyObject arguments.
If the incoming PyObject is of the same type as myclass I 
would like to be able to coerce it directly to myclass and continue,
otherwise if it is of type PyFloat, or PyInteger,
I would like to be able to extract the relevant numbers, create a new
 myclass object and continue. 

Unforunately the PyObject I get back is a 
org.python.core.PyJavaInstance which I cannot find any obvious way 
to crack and or convert back to a myclass object. Is the original
myclass object burried in there somewhere or am I barking up
the wrong tree and its gone for good?

Help appreciated
thanks
doug



More information about the Python-list mailing list