Issue222828
Created on 2000-11-18.19:19:53 by bckfnn, last changed 2000-11-18.22:41:33 by bckfnn.
| Messages | |||
|---|---|---|---|
| msg101 (view) | Author: Finn Bock (bckfnn) | Date: 2000-11-18.19:19:53 | |
I append a simple example analogous to the one in demo/javaclasses.
jpythonc should generate methods in the "Simple" proxy class,
based on the signatures in the "@sig ..." docstrings in Simple.py.
Unfortunately, this does not happen when class Simple does not inherit
from anybody. As soon as I add the inheritance relationship to awt,
(outcommented parts, modelled after Graph.py) everything works fine.
Best regards -te
---- Simple.py ---
# from java import awt
# class Simple(awt.Canvas):
class Simple:
def __init__(self, x="Hi, I.m the default initvalue"):
"@sig public Simple(java.lang.String x)"
self.val=x
def output(self):
"@sig public void output()"
print self.val
if __name__=="__main__":
s=Simple("Hello, World")
s.output()
The problem is already apparent after invoking jpythonc - in the generated
Simple.java
file, the constructors and the output method are missing. I append my java
"client"
class only FYI:
--- usesimple.java: ---
import org.python.core.*;
class usesimple {
public static void main(String[] args) {
Simple s;
s=new Simple("Hello from Java");
s.output();
}
}
|
|||
| msg102 (view) | Author: Finn Bock (bckfnn) | Date: 2000-11-18.22:41:33 | |
This is not a bug. To make jythonc create a proxy class, the class must inherit from a java class or java interface. Use java.lang.Object if no actual class is required. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2000-11-18 19:19:53 | bckfnn | create | |
Supported by Python Software Foundation,
Powered by Roundup