This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients belopolsky, seberg, skrah
Date 2014-09-26.13:40:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411738806.3.0.0901652933404.issue22445@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-26 13:40:06skrahsetrecipients: + skrah, belopolsky, seberg
2014-09-26 13:40:06skrahsetmessageid: <1411738806.3.0.0901652933404.issue22445@psf.upfronthosting.co.za>
2014-09-26 13:40:06skrahlinkissue22445 messages
2014-09-26 13:40:06skrahcreate