From: <bc...@wo...> - 2001-01-22 22:37:39
|
[Chris Atkins] >I am running jython 2.0 release on hpux 11 with jdk1.2.2.07. > >I run my jython interpretter >with -Dpython.security.respectJavaAccessibility= 0 and =false. > >In both cases, I am unable to access protected methods of a class. > >I just switched out my jar file from using jpython1.1 to jython2.0, and it >works under under jpython1.1 > >My python code looks like the following: > >print foo.toPrintString(obja, string1, string2) > >I get the following error: >TypeError: toPrintString(): expected 0-2 args; got 3 Well, it works for me. I made some small changes: abstract public class fooBase { public String toPrintString() { return "here1"; } public String toPrintString(String initialIndent) { return "here2"; } public String toPrintString(String initialIndent, String name) { return "here3"; } abstract protected String toPrintString(java.lang.Object fooObj, String initialIndent, String name); } public class foo extends fooBase { protected String toPrintString(Object obj, String initialIndent, String name) { return "here4"; } } jython -Dpython.security.respectJavaAccessibility=false Jython 2.0 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import foo >>> print foo().toPrintString(1, "string1", "string2") here4 >>> regards, finn |