[Benjamin Collar]
>So, say I've got a java class A, and a "subclass" B done in jython. Should
>I be able to do the following in a java program:
>
>A a = null;
>Class c (previously initialized to have an instance of B);
>
>a = (A) c.newInstance();
>
>If not, why not?
You can't create instances of jython subclasses with newInstance because
of a bug in Jython-2.0. You will eventually end up with a message like:
module '__main__' has no attribute '__main__$B'
This bug have been fixed in the CVS and the fix will be included in the
up comming Jython-2.1.
regards,
finn
|