from datetime import datetime
from typing import Sequence


class LoopedListDateIterator(object):
    def __init__(self, values: Sequence[datetime]):
        self.values = values
        self.current_index = 0

    def __next__(self):
        value = self.values[self.current_index]
        self.current_index += 1
        if self.current_index > len(self.values):
            self.current_index = 0
        return value
