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

Code before:
            self.starting_mobject,
            self.target_mobject,
            self.target_copy,
        ]

    def get_all_families_zipped(self) -> Iterable[tuple]:  # more precise typing?
        mobs = [
            self.mobject,
            self.starting_mobject,
            self.target_copy,
        ]
        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)

Review comment (suggestion):
The distinction between `ReplacementTransform` and `Transform` would be better suited as a note.
```suggestion
    """Replaces and morphs a mobject into a target mobject.
```

Code after:
            self.starting_mobject,
            self.target_mobject,
            self.target_copy,
        ]

    def get_all_families_zipped(self) -> Iterable[tuple]:  # more precise typing?
        mobs = [
            self.mobject,
            self.starting_mobject,
            self.target_copy,
        ]
        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)