Re: [Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-24 Thread Travis Oliphant
On Aug 22, 2011, at 7:35 AM, Mark Dickinson wrote: > On Mon, Aug 22, 2011 at 1:30 PM, Stefan Krah > wrote: >> Numpy arrays and memoryview currently have different representations >> for shape and strides if ndim = 0: >> > from numpy import * > x = array(9, int32) > x.ndim >> 0

Re: [Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-23 Thread Stefan Krah
Mark Dickinson wrote: > On Mon, Aug 22, 2011 at 1:30 PM, Stefan Krah > wrote: > > Numpy arrays and memoryview currently have different representations > > for shape and strides if ndim = 0: [...] > > I think the Numpy representation is nicer. Also, I think that memoryviews > > should attempt to

Re: [Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-22 Thread Mark Dickinson
On Mon, Aug 22, 2011 at 1:30 PM, Stefan Krah wrote: > Numpy arrays and memoryview currently have different representations > for shape and strides if ndim = 0: > from numpy import * x = array(9, int32) x.ndim > 0 x.shape > () x.strides > () m = memoryview(x) m.nd

[Numpy-discussion] memoryview shape/strides representation for ndim = 0

2011-08-22 Thread Stefan Krah
Hello, Numpy arrays and memoryview currently have different representations for shape and strides if ndim = 0: >>> from numpy import * >>> x = array(9, int32) >>> x.ndim 0 >>> x.shape () >>> x.strides () >>> m = memoryview(x) >>> m.ndim 0L >>> m.shape is None True >>> m.strides is None True I t