import itertools


def sequence(start=0, step=1):
    """:yaql:sequence

    Returns an iterator to the sequence beginning from start with step.

    :signature: sequence(start => 0, step => 1)
    :arg start: start value of the sequence. 0 is value by default
    :argType start: integer
    :arg step: the next element is equal to previous + step. 1 is value by
        default
    :argType step: integer
    :returnType: iterator

    .. code::

        yaql> sequence().take(5)
        [0, 1, 2, 3, 4]
    """
    return itertools.count(start, step)