dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.71k stars 960 forks source link

schedule.every expects int instead of float #559

Open Benedict-Mullins opened 1 year ago

Benedict-Mullins commented 1 year ago

floats seem to still work so it may just be a type hinting mistake. def every(interval: int = 1) -> Job should become def every(interval: float = 1) -> Job

SijmenHuizenga commented 1 year ago

The interval is passed into datetime.timedelta, and apparently float arguments are supported. So i guess floats should indeed work just fine. However, i would be hesitant to change the typing without also adding some unit to verify it defiantly works and keeps working in the future. I'm happy to review and merge a pr like that.