def generic_duple_range(start, end, step):
    """
    Sort of like range(), but it supports anything where you can check
    if start < end and do start += step.

    Also returns each value + the next value
    """
    while start < end:
        next = start + step
        yield start, next
        start = next
