From: Steinar R. E. <ste...@fi...> - 2001-04-30 13:08:45
|
Hi Can anyone please give me some guidance on this. I try to create a = system where I use Java classes that are subclassed for prototyping in = Jython. Within the rest of the Java code (after initialization) I would = like to refer to standard Java classes rather than PyObject. Hence, I = try to subclass a Java class in Python and later just use the Java class = itself when calling methods. Am I trying to do something that is not possible within the Jython = framework, or is there away around it. Java : class MyClass { void Method() } Jython : def PyMyClass (MyClass): def Method() Java (Factory class) class MyClassFactory public MyClass createMyClass() { /* use PythonInterpreter to create PyObject instance of PyMyClass() =20 This works fine. I can call methods here (with invoke) */=20 MyClass p=3D(MyClass) myPyObject;=20 // Why does this typecase fail (error on PyInstance) ? // I thought this cast would work since the PyMyClass object = subclasses MyClass... ?? =20 } =20 |