From: Robert W. B. <rb...@di...> - 2001-10-25 20:41:54
|
On Thu, 25 Oct 2001, Andres Corrada-Emmanuel wrote: > Hello, > My problem has evolved to this thread. Let me recapitulate my intent: > > To create a Java class using Python code. The Python class subclasses from > a class in some package "edu.umass.cs.ciir.metamorph". > > I compile the Python class to a .class file using jythonc with the > package switch. The resultant .java file has the correct package > declaration: > > package edu.umass.cs.ciir.metamorph; > > at the top of the file. The package statement does not ensure that access occurs from this class. Creating 'dynamicism' means using indirection. Jython's indirection means that the attribute request may not originate in the class found in the generated .java file. > My Python class tries to access a package-accesible super attribute but > fails. If I make that attribute public it succeeds. This is > unsatisfactory. I'm trying to use someone elses code and I cannot change > the attribute properties. > > Can I still use Jython or do I need to abandon this line of approach and > resign myself to having to program in Java directly? Yes. You can set python.respectJavaAccessibility to false and use Jython. Even if you do not do so, you do not have to abandon Jython. Instead, write only a wrapper class in java that makes access Jython-friendly, then go about the project in Jython. -robert |