Re: [Numpy-discussion] deprecating assignment to ndarray.data

2016-01-22 Thread Nathaniel Smith
On Thu, Jan 21, 2016 at 10:24 PM, Jonathan J. Helmus wrote: > On 1/21/2016 8:32 PM, Nathaniel Smith wrote: >> >> >> > Does this apply in any way to the .data attribute in scipy.sparse >> > matrices? >> >> Nope! >> >> -n >> > > How about the .data attribute of masked arrays?

[Numpy-discussion] deprecating assignment to ndarray.data

2016-01-21 Thread Nathaniel Smith
So it turns out that ndarray.data supports assignment at the Python level, and what it does is just assign to the ->data field of the ndarray object: https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/getset.c#L325 This kind of assignment been deprecated at the C level since

Re: [Numpy-discussion] deprecating assignment to ndarray.data

2016-01-21 Thread Juan Nunez-Iglesias
Does this apply in any way to the .data attribute in scipy.sparse matrices? I fiddle with that quite often! On Fri, Jan 22, 2016 at 11:21 AM, Nathaniel Smith wrote: > So it turns out that ndarray.data supports assignment at the Python > level, and what it does is just assign to

Re: [Numpy-discussion] deprecating assignment to ndarray.data

2016-01-21 Thread Nathaniel Smith
On Jan 21, 2016 6:17 PM, "Juan Nunez-Iglesias" wrote: > > Does this apply in any way to the .data attribute in scipy.sparse matrices? Nope! -n ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org

Re: [Numpy-discussion] deprecating assignment to ndarray.data

2016-01-21 Thread Jonathan J. Helmus
On 1/21/2016 8:32 PM, Nathaniel Smith wrote: > Does this apply in any way to the .data attribute in scipy.sparse matrices? Nope! -n How about the .data attribute of masked arrays? I'm guessing there may be a decent amount of code that uses array.data to try to duck-type ndarrays and