numpy/numpy — pull request #2773 by seberg (2012-11-30 13:52:24+00:00)
Title: FIX: Clean requested strides

Sorry if I spam with this PR, but this is the alternative approach for https://github.com/numpy/numpy/pull/2735 that I also mentioned there, and would in a similar form probably also be necessary if it is opted to do a deprecation process to change flags behaviour.

As far as I can see, this should fix all problems found yet, by cleaning up strides when an array (or buffer) is explicitly requested to be contiguous. Of course potentially someone does only check the flags and then relies on clean strides, but at least it is not the case for scipy and sklearn.
It means that some more checks have to be run in these cases, which unfortunately makes `np.array(arr, copy=True, order='C')` a bit slower if `arr` is already clean contiguous, but I doubt that is a big issue.

This still lacks tests for the buffer interface, since it seems necessary to write them in C.