def Iterate(items, times=1):
    """
    Iterate over a list of items. This particular easing is very useful
    for creating image animations, e.g.::

        walk_images = [spyral.Image('f1.png'), spyral.Image('f2.png'), spyral.Image('f3.png')]
        walking_animation = Animation('image', easing.Iterate(walk_images), 2.0, loop=True)
        my_sprite.animate(walking_animation)

    :param list items: A list of items (e.g., a list of
                       :class:`Images <spyral.Image>`).
    :param int times: The number of times to iterate through the list.
    """

    def iterate_easing(sprite, delta):
        # We preturb the result slightly negative so that it ends on
        # the last frame instead of looping back to the first
        i = round(delta * len(items) * times)
        return items[int(i % len(items))]

    return iterate_easing