From: Brian B. <spa...@gm...> - 2008-07-24 15:24:19
|
If I do the following in Java: Foo foo = new Foo(); // Foo is a user-defined class. PythonInterpreter pi = new PythonInterpreter(); pi.set("foo", foo); pi.execfile("somepath") Then, in the jython file "somepath" I have: print type(foo) The jython prints: <type 'javainstance'> Now the question: I want to do introspection on foo. I.e. I want to do: if type(foo) is Types.[insert some type here] : print "Found type for foo" But I cannot find anything to insert in the braces which matches the type of foo. I would expect it to be Types.JavaInstance, but no such luck. Any help would be appreciated. b.t.w. I attempted to research this by searching on 'javainstance' and other key words in the user-group archives, but in fact can't get the search to results for *any* keyword - e.g. something as simple as "classpath". Is there a known problem with search on the jython user-group archive? Thanks in advance, Bunker |