1

I'm working with some code from a year or two ago and it has:

import pendulum
pendulum.Interval(minutes=1000)

This worked with pendulum version 1.5.0, but doesn't work with the latest version 2.0.5. Is there an equivalent of pendulum.Interval in the latest version?

wordsforthewise
  • 13,746
  • 5
  • 87
  • 117

3 Answers3

2

The pendulum Interval changed to Duration since version 2.0. This can be found here, docu. So the replacement to Interval is:

from pendulum import Duration
Duration(minutes=1000)
Ioan Grozea
  • 115
  • 1
  • 11
1

The code used Interval to loop through a time range. It looks like the latest version should be:

dt = pendulum.now()
dt.add(minutes=1000)
wordsforthewise
  • 13,746
  • 5
  • 87
  • 117
0

Try this :- pendulum.duration(minutes=1000)