[Numpy-discussion] Setting WRITEABLE flag on array scalar

Stefan van der Walt stefan at sun.ac.za
Thu Jan 10 14:02:52 EST 2008


Hi,

On Thu, Jan 10, 2008 at 10:21:28AM -0600, Travis E. Oliphant wrote:
> You can't do it, because there is no place for the information to go.   
> The array scalars are always read-only anyway.  So, there should be no 
> reason to set this flag.

Right, I was confused because I saw:

In [1]: x = N.bool_(3)

In [2]: x
Out[2]: True

In [3]: x += 1

In [4]: x
Out[4]: 2

But now I see that iadd does not actually change the original value.

Thanks
Stéfan



More information about the NumPy-Discussion mailing list