Message5982
I see the problem. You're using jarray, instead of the standard Python array package. jarray maintains the old interface, but it's just a thin wrapper of array. Because it's just for backwards compatibility, we haven't deprecated jarray, but we're not going to change it either.
So do this:
>>> import array
>>> import java
>>> x = array.array(java.lang.String, [u'hello', u'world'])
>>> x
array(java.lang.String, [u'hello', u'world'])
But if you do this:
>>> import jarray
>>> y = jarray.array(['upside', 'down'], java.lang.String)
>>> y
array(java.lang.String, [u'upside', u'down'])
But I would not rely too much on eval'ing such string representations. For certain situations, it will work, but not often. Even in this case, it's not directly evaluable since I didn't import array from array. In general, and unlike other languages like Perl and I believe Ruby, eval is just not commonly used in Python.
I believe we can now close this bug as a support issue. Changing the title to reflect this as well. |
|
Date |
User |
Action |
Args |
2010-08-17 16:24:56 | zyasoft | set | messageid: <1282062296.46.0.272163228243.issue1644@psf.upfronthosting.co.za> |
2010-08-17 16:24:56 | zyasoft | set | recipients:
+ zyasoft, brice.fernandes |
2010-08-17 16:24:56 | zyasoft | link | issue1644 messages |
2010-08-17 16:24:55 | zyasoft | create | |
|