From: Delaney, Timothy <tde...@av...>
> > From: Edward Povazan [mailto:epo...@te...]
> >
> > Thanks for the explanation.
> > I now understand that obj is a String on the java side, but a
> > PyString on
> > the jython side.
> > The reason I was asking is that I create my user interface widgets in
> > Jython, which includes many custom controls, and sometimes I
> > need to do
> > object.toString() which of course fails on a PyString.
> > So I need a wrapper around string objects ... a little
> > annoying. Oh well.
>
> If you are doing object.toString() in the Python code, you should instead
> use str(object).
>
True. I can only add that if you subclass a Java class from Jython
then you should define both toString and __repr__/__str__,
toString for java side and the other to make str work.
regards, Samuele Pedroni.
|