Skip to content

MLR113: Transform source and target are the same object

qual reports MLR113 when the source and target of a Transform / ReplacementTransform are provably the same live object (the same allocation-site identity with singleton cardinality). The animation morphs the mobject into its current state and shows no change; a ReplacementTransform additionally replaces the object with itself.

  • Default severity: info
  • Minimum confidence: high
  • Implementation phase: 2
  • Fix: none

The rule never fires on Maybe aliasing (branch-dependent identity), on a .copy() target (a copy is always a new identity), or when a custom path is given (path_arc / path_func make even a self-transform visibly move). Arc-path subclasses such as ClockwiseTransform are not judged at all for the same reason.

Wrong:

square = Square()
self.add(square)
self.play(Transform(square, square))  # no visible change

Right:

self.play(Transform(square, square.copy().shift(RIGHT)))
self.play(Transform(square, square, path_arc=PI))  # visible arc motion