dbader / dbader/schedule

Random schedule doesn't work with floats

Open
#593 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
12.3k
Forks
999
PR merge metrics
No merged PRs in 30d

Description

Hi!

I was just trying to get the scheduler to schedule things at random frequencies after than 1 time a second.
I don't actually care too much about it being perfect, just a useful library to schedule things.

This line is making that impossible: https://github.com/dbader/schedule/blob/master/schedule/__init__.py#L715

Would it be possible to replace the logic with a (maxval-minval)*random.random()+minval maybe? I imagine that's what randrange does internally (or something similar). The only concern is this would be changing the behavior from only integer values being output to non integer values.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.