Message165
I get
TypeError: invalid self argument
when I try to sub class a java class which is in a package and call the java
class constructor from jpython constructor.This happens _only_ if my current
directory is the base of the package name. ie for the example below os.getcwd()
should return the directory name just below test.
This seems to work in 1.1beta3
------------------------------------------------------------------------------
Eg :
// Java File javaParent.java in directory test
package test;
public javaParent {
public javaParent(int x) {
System.out.println("constructor "+x);
}
}
//End of file
Jpython syntax to sub class from the above..
>>> from test import javaParent
>>> class pythonClass(javaParent) :
def __init__(self,*args) :
apply(javaParent.__init__,(self,)+args)
>>> p = pythonClass(1)
Traceback (innermost last):
File "<console>", line 1, in ?
File "<console>", line 3, in __init__
TypeError: invalid self argument
|
|
Date |
User |
Action |
Args |
2008-02-20 17:16:43 | admin | link | issue222857 messages |
2008-02-20 17:16:43 | admin | create | |
|