Repository: ManimCommunity/manim
File: manim/animation/transform.py (Python)

Code before:
        return zip(*[mob.family_members_with_points() for mob in mobs])

    def interpolate_submobject(
        self,
        submobject: Mobject,
        starting_submobject: Mobject,
        target_copy: Mobject,
        alpha: float,
    ) -> "Transform":
        submobject.interpolate(starting_submobject, target_copy, alpha, self.path_func)
        return self


class ReplacementTransform(Transform):
    """Replace the mobject with target_mobject (like Transform does), and shows the target_mobject (whereas Transform shows the mobject)

    Fades one mobject into another. Transform M1 is shown M2 doies not change, only M1

        Parameters
        ----------
        mobject
            The starting :class:`~.Mobject`.
        target_mobject
            The target :class:`~.Mobject`.
        kwargs
            Further keyword arguments are passed to the parent class.

        Examples
        --------

        .. manim:: ReplacementTransformOrTransform

            class ReplacementTransformOrTransform(Scene):
                def construct(self):
                    # Set the context
                    text_0 = Tex("ReplacementTransform vs Transform", color = BLUE).scale(0.9).shift(2.5*UP)
                    self.play(Write(text_0))
                    text_1 = Tex("Text no. 1").shift(UP + 2*LEFT)
                    text_2 = Tex("Text no. 2").next_to(text_1, DOWN)
                    text_3 = Tex("Text no. 3").next_to(text_2, DOWN)
                    text_4 = Tex("Text no. 4").next_to(text_1, 5*RIGHT)
                    text_5 = Tex("Text no. 5").next_to(text_4, DOWN)
                    text_6 = Tex("Text no. 6").next_to(text_5, DOWN)
                    self.play(Write(text_1))
                    self.play(Write(text_2))
                    self.play(Write(text_3))
                    self.play(Write(text_4))
                    self.play(Write(text_5))
                    self.play(Write(text_6))
                    self.wait()
                    # Explanation between ReplacementTransform and Transform

Review comment (suggestion):
```suggestion
            Further keyword arguments that are passed to :class:`Transform`.
```

Code after:
        return zip(*[mob.family_members_with_points() for mob in mobs])

    def interpolate_submobject(
        self,
        submobject: Mobject,
        starting_submobject: Mobject,
        target_copy: Mobject,
        alpha: float,
    ) -> "Transform":
        submobject.interpolate(starting_submobject, target_copy, alpha, self.path_func)
        return self


class ReplacementTransform(Transform):
    """Replaces and morphs a mobject into a target mobject.

    Parameters
    ----------
    mobject
        The starting :class:`~.Mobject`.
    target_mobject
        The target :class:`~.Mobject`.
    kwargs
        Further keyword arguments that are passed to :class:`Transform`.

    Examples
    --------

    .. manim:: ReplacementTransformOrTransform
        :quality: low

        class ReplacementTransformOrTransform(Scene):
            def construct(self):
                # set up the numbers
                r_transform = VGroup(*[Integer(i) for i in range(1,4)])
                text_1 = Text("ReplacementTransform", color=RED)
                r_transform.add(text_1)

                transform = VGroup(*[Integer(i) for i in range(4,7)])
                text_2 = Text("Transform", color=BLUE)
                transform.add(text_2)

                ints = VGroup(r_transform, transform)
                texts = VGroup(text_1, text_2).scale(0.75)
                r_transform.arrange(direction=UP, buff=1)
                transform.arrange(direction=UP, buff=1)

                ints.arrange(buff=2)
                self.add(ints, texts)

                # The mobs replace each other and none are left behind