def iter_strides_c_contig(arr, shape=None):
    shape = arr.shape if shape is None else shape
    itemsize = arr.itemsize

    def gen():
        yield itemsize
        sum = 1
        for s in reversed(shape[1:]):
            sum *= s
            yield sum * itemsize

    for i in reversed(list(gen())):
        yield i
yields the c-contigous strides
dataset/ETHPy150Open numba/numba/numba/dummyarray.py/iter_strides_c_contig