[Numpy-discussion] memoryview shape/strides representation for ndim = 0
Wed Aug 24 23:42:06 CDT 2011
On Aug 22, 2011, at 7:35 AM, Mark Dickinson wrote:
> On Mon, Aug 22, 2011 at 1:30 PM, Stefan Krah <firstname.lastname@example.org> wrote:
>> Numpy arrays and memoryview currently have different representations
>> for shape and strides if ndim = 0:
>>>>> from numpy import *
>>>>> x = array(9, int32)
>>>>> m = memoryview(x)
>>>>> m.shape is None
>>>>> m.strides is None
>> I think the Numpy representation is nicer. Also, I think that memoryviews
>> should attempt to mimic the underlying object as closely as possible.
> Agreed on both points. If there's no good reason for m.shape and
> m.strides to be None, I think it should be changed.
I can't think of any good reason not to change it to use the NumPy defaults. This sounds right to me.
> NumPy-Discussion mailing list
More information about the NumPy-Discussion