From: Harlan H. <ha...@ot...> - 2001-05-22 21:52:48
|
> Date: Mon, 21 May 2001 18:50:33 -0400 > From: D-Man <ds...@ri...> > > Could you share some of that python code? > > The following code works fine for me: > > ========== Foo.py ============== > import java > > class Foo( java.lang.Object ) : > def __init__( self ) : > """ > @sig public Foo() > """ > print "Foo.__init__" OK, i've figured this one out. I was importing java.math and java.util. for some reason that masks java.lang.Object. When i dropped my "import java.util" in favor of "import java", jythonc was able to let me extend from java.lang.Object. is this a bug in jythonc? > ========== Bar.java =========== > class Bar > { > public static void main( String[] argv ) > { > System.out.println( "main ..." ) ; > Foo obj = new Foo() ; > System.out.println( "end of main" ) ; > } > } I'm using factory methods, and several classes in one .py file, but the code is similar public class session { //is it necessary to load the module, and have it call initConstants? //that's what the following two lines do.. private static pysession._PyInner mod = new pysession._PyInner(); private static PyCode main = mod.getMain(); public static Object createSession() { return new pysession.session(SessionFactory.createSession()); } public static Object createSessionGroup() { return new pysession.sessiongroup(SessionFactory.createSessionGroup()); } } ---- ha...@ot... x293 |