2021/05.py
def dirange(start, end=None, step=1) -> Generator[int, None, None]:
    """
    Directional, inclusive range. This range function is an inclusive version of
    :class:`range` that figures out the correct step direction to make sure that it goes
    from `start` to `end`, even if `end` is before `start`.

    >>> dirange(2, -2)
    [2, 1, 0, -1, -2]
    >>> dirange(-2)
    [0, -1, -2]
    >>> dirange(2)
    [0, 1, 2]
    """
    assert step > 0
    if end is None:
        start, end = 0, start

    if end >= start:
        yield from irange(start, end, step)
    else:
        yield from range(start, end - 1, step=-step)

    Directional, inclusive range. This range function is an inclusive version of
    :class:`range` that figures out the correct step direction to make sure that it goes
    from `start` to `end`, even if `end` is before `start`.

    >>> dirange(2, -2)
    [2, 1, 0, -1, -2]
    >>> dirange(-2)
    [0, -1, -2]
    >>> dirange(2)
    [0, 1, 2]
    
Directional, inclusive range. This range function is an inclusive version of
Directional inclusive range . This range function is an inclusive version of
def dirange(start, end=None, step=1) -> Generator[int, None, None]:
    assert step > 0
    if end is None:
        start, end = 0, start
    if end >= start:
        yield from irange(start, end, step)
    else:
        yield from range(start, end - 1, step=-step)
def dirange ( start , end = None , step = 1 ) -> Generator [ int , None , None ] : assert step > 0 if end is None : start , end = 0 , start if end >= start : yield from irange ( start , end , step ) else : yield from range ( start , end - 1 , step = - step )
Directional, inclusive range.
Directional inclusive range .
"""
    Directional, inclusive range. This range function is an inclusive version of
    :class:`range` that figures out the correct step direction to make sure that it goes
    from `start` to `end`, even if `end` is before `start`.

    >>> dirange(2, -2)
    [2, 1, 0, -1, -2]
    >>> dirange(-2)
    [0, -1, -2]
    >>> dirange(2)
    [0, 1, 2]
    """
start
end
step
class
`range` that figures out the correct step direction to make sure that it goes
from `start` to `end`, even if `end` is before `start`.


` range ` that figures out the correct step direction to make sure that it goes from ` start ` to ` end ` even if ` end ` is before ` start ` .