title: How to correctly use enterabs from scheduler
body: <p>I'm trying to schedule something to run periodically, using the code below:</p>
  <pre><code>import sched
  import time
  from datetime import datetime, timedelta
  
  def foo(s, t_end):
      now = datetime.now()
      print(now)
      # Schedule the next run of this function, but only if it'll be before 't_end'
      next_run = now + timedelta(seconds=1)
      if next_run &lt;= t_end:
          s.enter(1, 1, foo, (s, t_end,))
          # s.enterabs(next_run, 1, foo, (s, t_end,)) # &lt;-- why doesn't this work?
  
  if __name__ == '__main__':
      s = sched.scheduler(time.time, time.sleep)
      t_end = datetime.now() + timedelta(seconds=5)
      foo(s, t_end)
      s.run()
  </code></pre>
  <p>This runs exactly like it should... the script calls <code>foo</code> exactly 5 times and then exits (with 1 second delay between the calls).</p>
  <p>But if I change the <code>s.enter(...)</code> to <code>s.enterabs(...)</code> and pass in the calculated time when <code>foo</code> should be called again, it throws the following error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/tmp/test.py&quot;, line 18, in &lt;module&gt;
      s.run()
    File &quot;/usr/lib/python3.9/sched.py&quot;, line 141, in run
      if time &gt; now:
  TypeError: '&gt;' not supported between instances of 'datetime.datetime' and 'float'
  </code></pre>
  <p>What am I doing wrong?</p>