Message5982

Author zyasoft
Recipients brice.fernandes, zyasoft
Date 2010-08-17.16:24:55
SpamBayes Score 1.68993e-12
Marked as misclassified No
Message-id <1282062296.46.0.272163228243.issue1644@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-08-17 16:24:56zyasoftsetmessageid: <1282062296.46.0.272163228243.issue1644@psf.upfronthosting.co.za>
2010-08-17 16:24:56zyasoftsetrecipients: + zyasoft, brice.fernandes
2010-08-17 16:24:56zyasoftlinkissue1644 messages
2010-08-17 16:24:55zyasoftcreate