def my_range(start, end, step):
    """Iterable `range` adapted for fractions.

    Parameters
    ----------
    start : Number
        Start value (included).
    end : Number
        End value (excluded).
    step : Number
        Increment of the counter.

    Examples
    --------
        >>> for x in my_range(0, 1, Fraction(1, 3)):
        ...     print(x)
        0
        1/3
        2/3

        >>> for x in my_range(1, 0, - Fraction(1, 3)):
        ...     print(x)
        1
        2/3
        1/3
    """
    val = start
    if step > 0:
        while val < end:
            yield val
            val += step
    else:
        while val > end:
            yield val
            val += step
