problem removing task

I am quite puzzled, I am trying to remove task once they are not needed anymore but they are executed one more time.

class Updatable(object):
     def run(self, name):
          self.pTask = taskMgr.add(self.update, name)

     def delete(self):
          removed = taskMgr.remove(self.pTask)
          assert removed
          del self.pTask

     def update(self):
          try :
              next_node =
              if next_node is None :
                  self.delete() # no more update!!!!
          except StopIteration:
              raise AssertionError # arg! still updating !!

many prints and the raise statement prooved me that :
1/ the delete method is called
2/ the taskMgr.remove returns True
3/ the update is called once after the delete

What am i doing wrong ?

Hmm, it’s always a little problematic when a task removes itself. But why not just return Task.done from the task function?