News for hackers. Stuff that matters.
Re:Opnieuw: A simple and intuitive retrying library for Python by tijmendj on Wednesday February 05, 2020 @08:20AM (#22246463)
I agree it might look a bit excessive, but it greatly cuts down on complexity and possible unexpected behavior.

If you accept '60s' as 60 seconds, then the next questions are:

- Will it also accept '60000ms'?

- What does it do if I pass an int or float anyway? Will it implicitly take it to be seconds?

- Will it throw an exception if I use an unexpected value? If so, which exceptions can I expect? Will it just chug along and use a default?

Re:Opnieuw: A simple and intuitive retrying library for Python by VBprogrammer on Wednesday February 05, 2020 @08:46AM (#22246629)
Something I picked up from another developer is to use timedelta for these type of parameters. It avoids hoping that you get the right granularity for everyone.

   retry_window_after_first_call=timedelta(minutes=3.5)
   retry_window_after_first_call=timedelta(days=2)
   retry_window_after_first_call=timedelta(minutes=50)
Re:Opnieuw: A simple and intuitive retrying library for Python by leetrout on Thursday February 06, 2020 @03:02PM (#22259732)
Nice! Yes this is the better option. IMO, should just be

  retry_window=timedelta(...)