[Numpy-discussion] When are 0-d arrays writeable?

Nathaniel Smith njs@pobox....
Fri Nov 23 04:49:37 CST 2012


On 23 Nov 2012 03:34, "Charles R Harris" <charlesr.harris@gmail.com> wrote:
>
> Examples,
>
> In [13]: ones(()).flags.writeable
> Out[13]: True
>
> In [14]: (-ones(())).flags.writeable
> Out[14]: False
>
> In [15]: (-1*ones(())).flags.writeable
> Out[15]: False
>
> In [16]: (1 + ones(())).flags.writeable
> Out[16]: False
>
> In [17]: array(1)
> Out[17]: array(1)
>
> In [18]: array(1).shape
> Out[18]: ()
>
> In [19]: array(1).flags.writeable
> Out[19]: True

Looks like a bug in the ufunc output value setup code or something?

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20121123/fd8c922b/attachment.html 


More information about the NumPy-Discussion mailing list