Stefan Krah added the comment: Ok, here's my take on the situation:
1) As far as Python is concerned, shape[0] == 1 was already special-cased, so people could not rely on canonical Fortran or C strides anyway. 2) Accessing an element via strides should be done using PyBuffer_GetPointer(), which can of course handle non-canonical strides. 3) Breakage will only affect NumPy users, since practically no one else is using multidimensional arrays. Regarding your option 2b): I think it may be confusing, the buffer protocol is already so complicated. So, I think purity wins here. If you are sure that all future NumPy versions will ship with precise contiguity checks, then I'll commit the new patch in 3.5 (earlier versions should not be changed IMO). I've moved the checks for 0 in shape[i] to the beginning (len == 0). I hope there are no applications that set len incorrectly, but they would be severely broken anyway. ---------- stage: -> patch review versions: +Python 3.5 Added file: http://bugs.python.org/file36738/issue22445.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22445> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com