Message1560
In Jython2.1,
Variables holding an integer, long, float or string values are interpreted as jython data objects i.e., PyInteger, PyLong, PyFloat, PyString respectively.
These Objects support toString() method which is used by us in many places.
for eg:
>>> c = 1
>>> c.toString()
'1'
here type(c) = <jclass org.python.core.PyInteger at 7481256>
In Jython2.2,
Variables holding an integer, long, float or string values are interpreted as basic types i.e, int, long, float, str respectively.
They don’t have toString() method…hence our scripts becomes incompatible throwing the below exception.
AttributeError: 'int' object has no attribute 'toString'
for eg:
>>> c = 1
>>> c.toString()
Traceback (innermost last):
File "<console>", line 1, in ?
AttributeError: 'int' object has no attribute 'toString'
>>> type(c) = <type 'int'>
Can you please let us know
1.Why the type has been changed?any link/document that addresses it?
2.How to convert the primitive type to String in Jython2.2?
Thanks a lot!!! |
|
| Date |
User |
Action |
Args |
| 2008-02-20 17:17:48 | admin | link | issue1707892 messages |
| 2008-02-20 17:17:48 | admin | create | |
|