
On Thu, Oct 21, 2010 at 2:11 PM, Pauli Virtanen <pav@iki.fi> wrote:
<snip>
Also, it is not correct to assume the dimensions are added to the end:
x = np.zeros((2,3),dtype=[('a','f8',(4,))]).T x.shape (3, 2) x['a'].shape (4, 3, 2)
There's a special branch in the field access code that does this for Fortran-order arrays. Or, more precisely, arrays with the fortran-order flag set. (IIRC, there are some ways to create arrays in Fortran order so that the flag does not get set.)
This seems to be somewhat of a mis-feature to me -- it makes predicting code behavior difficult to anticipate.
That sounds like it could be tricky to handle correctly, especially since it should probably work to compare Fortran-order arrays with non-Fortran ones. Does anything actually depend on this behavior? Maybe it's something that could change? -Mark