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 seberg
Recipients seberg
Date 2014-09-19.19:00:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411153250.02.0.529032306838.issue22445@psf.upfronthosting.co.za>
In-reply-to
Content
In NumPy we decided some time ago that if you have a multi dimensional buffer, shaped for example 1x10, then this buffer should be considered both C- and F-contiguous. Currently, some buffers which can be used validly in a contiguous fashion are rejected.

CPython does not support this currently possibly creating smaller nuisance if/once we change it fully in NumPy, see for example https://github.com/numpy/numpy/issues/5085

I have attached a patch which should (sorry I did not test this at all yet) relax the checks as much as possible. I think this is right, but we did some subtle breaks in user code (mostly cython code) when we first tried changing it, and while numpy arrays may be more prominently C/F-contiguous, compatibility issues with libraries checking for contiguity explicitly and then requesting a strided buffer are very possible.

If someone could give me a hint about adding tests, that would be great.
Also I would like to add a small note to the PEP in any case regarding this subtlety, in the hope that more code will take care about such subtleties.
History
Date User Action Args
2014-09-19 19:00:50sebergsetrecipients: + seberg
2014-09-19 19:00:50sebergsetmessageid: <1411153250.02.0.529032306838.issue22445@psf.upfronthosting.co.za>
2014-09-19 19:00:49seberglinkissue22445 messages
2014-09-19 19:00:49sebergcreate