Repository: ManimCommunity/manim
File: manim/mobject/geometry/shape_matchers.py (Python)

Code before:
    r"""A rectangle surrounding a :class:`~.Mobject`

    Examples
    --------
    .. manim:: SurroundingRectExample
        :save_last_frame:

        class SurroundingRectExample(Scene):
            def construct(self):
                title = Title("A Quote from Newton")
                quote = Text(
                    "If I have seen further than others, \n"
                    "it is by standing upon the shoulders of giants.",
                    color=BLUE,
                ).scale(0.75)
                box = SurroundingRectangle(quote, color=YELLOW, buff=MED_LARGE_BUFF)

                t2 = Tex(r"Hello World").scale(1.5)
                box2 = SurroundingRectangle(t2, corner_radius=0.2)
                mobjects = VGroup(VGroup(box, quote), VGroup(t2, box2)).arrange(DOWN)
                self.add(title, mobjects)
    """

    def __init__(
        self,
        *mobjects,
        color: ParsableManimColor = YELLOW,
        buff: float = SMALL_BUFF,
        corner_radius: float = 0.0,
        **kwargs,
    ) -> None:
        if not all(isinstance(mob, Mobject) for mob in mobjects):
            raise TypeError("Positional arguments can only have type Mobject")
        target = Group(*mobjects)
        super().__init__(
            color=color,
            width=target.width + 2 * buff,
            height=target.height + 2 * buff,
            corner_radius=corner_radius,
            **kwargs,
        )
        self.buff = buff
        self.move_to(target)


class BackgroundRectangle(SurroundingRectangle):
    """A background rectangle. Its default color is the background color
    of the scene.

    Examples
    --------

Review comment (suggestion):
```suggestion
        *mobjects: Mobject,
```
This way users can get errors in their IDE
Same with the other case of this happening

Code after:
from manim.mobject.geometry.polygram import RoundedRectangle
from manim.mobject.mobject import Mobject
from manim.mobject.types.vectorized_mobject import VGroup
from manim.utils.color import BLACK, RED, YELLOW, ManimColor, ParsableManimColor


class SurroundingRectangle(RoundedRectangle):
    r"""A rectangle surrounding a :class:`~.Mobject`

    Examples
    --------
    .. manim:: SurroundingRectExample
        :save_last_frame:

        class SurroundingRectExample(Scene):
            def construct(self):
                title = Title("A Quote from Newton")
                quote = Text(
                    "If I have seen further than others, \n"
                    "it is by standing upon the shoulders of giants.",
                    color=BLUE,
                ).scale(0.75)
                box = SurroundingRectangle(quote, color=YELLOW, buff=MED_LARGE_BUFF)

                t2 = Tex(r"Hello World").scale(1.5)
                box2 = SurroundingRectangle(t2, corner_radius=0.2)
                mobjects = VGroup(VGroup(box, quote), VGroup(t2, box2)).arrange(DOWN)
                self.add(title, mobjects)
    """

    def __init__(
        self,
        *mobjects: Mobject,
        color: ParsableManimColor = YELLOW,
        buff: float = SMALL_BUFF,
        corner_radius: float = 0.0,
        **kwargs: Any,
    ) -> None:
        from manim.mobject.mobject import Group

        if not all(isinstance(mob, Mobject) for mob in mobjects):
            raise TypeError(
                "Expected all inputs for parameter mobjects to be a Mobjects"
            )

        group = Group(*mobjects)
        super().__init__(
            color=color,
            width=group.width + 2 * buff,
            height=group.height + 2 * buff,
            corner_radius=corner_radius,