Repository: ManimCommunity/manim
File: manim/mobject/types/vectorized_mobject.py (Python)

Code before:
        >>> vg  # not modified
        VGroup(Square)
        >>> vg -= square
        >>> vg  # modifies vg
        VGroup()

    .. manim:: ArcShapeIris
        :save_last_frame:

        class ArcShapeIris(Scene):
            def construct(self):
                colors = [DARK_BROWN, BLUE_E, BLUE_D, BLUE_A, TEAL_B, GREEN_B, YELLOW_E]
                radius = [1 + rad * 0.1 for rad in range(len(colors))]

                circles_group = VGroup()

                # zip(radius, color) makes the iterator [(radius[i], color[i]) for i in range(radius)]
                circles_group.add(*[Circle(radius=rad, stroke_width=10, color=col)
                                    for rad, col in zip(radius, colors)])
                self.add(circles_group)

    """

    def __init__(
        self,
        *vmobjects: VMobject | Iterable[VMobject] | GeneratorType[VMobject],
        **kwargs,
    ):
        super().__init__(**kwargs)
        self.add(*vmobjects)

    def __repr__(self) -> str:
        return f'{self.__class__.__name__}({", ".join(str(mob) for mob in self.submobjects)})'

    def __str__(self) -> str:
        return (
            f"{self.__class__.__name__} of {len(self.submobjects)} "
            f"submobject{'s' if len(self.submobjects) > 0 else ''}"
        )

    def add(
        self,
        *vmobjects: VMobject | Iterable[VMobject] | GeneratorType[VMobject],
    ) -> Self:
        """Checks if all passed elements are an instance, or iterables of VMobject and then adds them to submobjects

        Parameters
        ----------
        vmobjects
            List or iterable of VMobjects to add


Review comment (suggestion):
```suggestion
        *vmobjects: VMobject | Iterable[VMobject]
```
There's actually no reason to use `GeneratorType[VMobject]`, `GeneratorType` is a subtype of `Iterable`.

Same thing below.

Code after:
        >>> vg -= square
        >>> vg  # modifies vg
        VGroup()

    .. manim:: ArcShapeIris
        :save_last_frame:

        class ArcShapeIris(Scene):
            def construct(self):
                colors = [DARK_BROWN, BLUE_E, BLUE_D, BLUE_A, TEAL_B, GREEN_B, YELLOW_E]
                radius = [1 + rad * 0.1 for rad in range(len(colors))]

                circles_group = VGroup()

                # zip(radius, color) makes the iterator [(radius[i], color[i]) for i in range(radius)]
                circles_group.add(*[Circle(radius=rad, stroke_width=10, color=col)
                                    for rad, col in zip(radius, colors)])
                self.add(circles_group)

    """

    def __init__(
        self,
        *vmobjects: VMobject | Iterable[VMobject],
        **kwargs,
    ):
        super().__init__(**kwargs)
        self.add(*vmobjects)

    def __repr__(self) -> str:
        return f'{self.__class__.__name__}({", ".join(str(mob) for mob in self.submobjects)})'

    def __str__(self) -> str:
        return (
            f"{self.__class__.__name__} of {len(self.submobjects)} "
            f"submobject{'s' if len(self.submobjects) > 0 else ''}"
        )

    def add(
        self,
        *vmobjects: VMobject | Iterable[VMobject],
    ) -> Self:
        """Checks if all passed elements are an instance, or iterables of VMobject and then adds them to submobjects

        Parameters
        ----------
        vmobjects
            List or iterable of VMobjects to add

        Returns
        -------