Wed, 23 Sep 2009 09:15:44 +0200, Hrvoje Niksic wrote:
[clip]
> Numpy arrays with the "base" property are deserialized as arrays
> pointing to a storage contained within a Python string.  This is a
> problem since such arrays are mutable and can mutate existing strings.
> Here is how to create one:

Please file a bug ticket in the Trac, thanks!

Here is a simpler way, although one more difficult to accidentally:

>>> a = numpy.frombuffer("A", dtype='S1')
>>> a.flags.writeable = True
>>> b = "A"
>>> a[0] = "B"
>>> b
'B'

-- 
Pauli Virtanen

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to