Skip to content

MLC125: remove_updater callback identity matches no registered updater

qual reports MLC125 when the callback passed to remove_updater definitely matches no registered updater. Manim removes updaters by function identity (mobject.py Mobject.remove_updater); an inline lambda is a fresh object every time and can never match, and a different function reference removes nothing.

  • Default severity: warning
  • Minimum confidence: high
  • Implementation phase: 2
  • Fix: none (storing the callback in a variable at registration time is suggested)

For a non-lambda mismatch the rule additionally requires the registered set to be provably complete: any registration with an unknown callback identity, or an unresolved call that may have registered one, silences the rule.

Wrong

def spin(mob, dt):
    mob.rotate(dt)

class Demo(Scene):
    def construct(self):
        square = Square()
        self.add(square)
        square.add_updater(spin)
        square.remove_updater(lambda m: m)  # fresh identity, removes nothing
def spin(mob, dt):
    mob.rotate(dt)

class Demo(Scene):
    def construct(self):
        square = Square()
        self.add(square)
        square.add_updater(spin)
        square.remove_updater(spin)