def interleave_none(a, b):
    result = []
    i = j = 0
    n = len(a) + len(b)
    while i + j < n:
        if a[i] is not None:
            result.append(a[i])
            i += 1
        else:
            result.append(b[j])
            i += 1
            j += 1
    return tuple(result)
This skips sizes because there's its not part of the iter api.
dataset/ETHPy150Open dask/dask/dask/array/core.py/interleave_none--crossover with--dataset/ETHPy150Open benoitc/gunicorn/tests/treq.py/request.match_iter