def __init__(self, interval: float, function: Callable, delay: Optional[float] = None, repeat=False,
                 args: Optional[list] = None, kwargs: Optional[dict] = None):
        Thread.__init__(self)
        self.interval = interval
        self.function = function
        self.delay = delay
        if self.delay is None:
            self.delay = self.interval
        self.repeat = repeat
        self.args = args if args is not None else []
        self.kwargs = kwargs if kwargs is not None else {}
        self.finished = Event()