src/cool_primes/utils.py
def filter_between(iterable, start=None, end=None):
    """
    Yield items from iterable in the range(start, end).

    Returns an iterator from the given iterable.
    """
    iterator = iter(iterable)
    if start is not None:
        # Drop values strictly less than start
        if partial is None:
            drop = lambda p: p < start
        else:
            # Skip over any values where v < start but
            # partial assigns operands from left so
            # it has to be written as start > p
            drop = partial(operator.gt, start)
        iterator = itertools.dropwhile(drop, iterator)
    if end is not None:
        # Take values strictly less than end
        if partial is None:
            take = lambda p: p < end
        else:
            # Halt at the first value where v >= end but
            # partial assigns operabds from left so it
            # has to be written as end > p
            take = partial(operator.gt, end)
        iterator = itertools.takewhile(take, iterator)
    return iterator

    Yield items from iterable in the range(start, end).

    Returns an iterator from the given iterable.
    
Yield items from iterable in the range(start, end).
Returns an iterator from the given iterable.
Yield items from iterable in the range ( start end ) . Returns an iterator from the given iterable .
def filter_between(iterable, start=None, end=None):
    iterator = iter(iterable)
    if start is not None:
        if partial is None:
            drop = lambda p: p < start
        else:
            drop = partial(operator.gt, start)
        iterator = itertools.dropwhile(drop, iterator)
    if end is not None:
        if partial is None:
            take = lambda p: p < end
        else:
            take = partial(operator.gt, end)
        iterator = itertools.takewhile(take, iterator)
    return iterator
def filter_between ( iterable , start = None , end = None ) : iterator = iter ( iterable ) if start is not None : if partial is None : drop = lambda p : p < start else : drop = partial ( operator . gt , start ) iterator = itertools . dropwhile ( drop , iterator ) if end is not None : if partial is None : take = lambda p : p < end else : take = partial ( operator . gt , end ) iterator = itertools . takewhile ( take , iterator ) return iterator
Yield items from iterable in the range(start, end).
Yield items from iterable in the range ( start end ) .
"""
    Yield items from iterable in the range(start, end).

    Returns an iterator from the given iterable.
    """ # Drop values strictly less than start # Skip over any values where v < start but # partial assigns operands from left so # it has to be written as start > p # Take values strictly less than end # Halt at the first value where v >= end but # partial assigns operabds from left so it # has to be written as end > p
iterable
start
end