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

Code before:
        Examples
        --------
        ::

            >>> from manim import Square, Rectangle, VGroup, Group, Mobject, VMobject
            >>> s, r, m, v = Square(), Rectangle(), Mobject(), VMobject()
            >>> vg = VGroup(s, r)
            >>> gr = Group(vg, m, v)
            >>> gr.get_family()
            [Group, VGroup(Square, Rectangle), Square, Rectangle, Mobject, VMobject]

        See also
        --------
        :meth:`~.Mobject.family_members_with_points`, :meth:`~.Mobject.align_data`

        """
        sub_families = [x.get_family() for x in self.submobjects]
        all_mobjects = [self] + list(it.chain(*sub_families))
        return remove_list_redundancies(all_mobjects)

    def family_members_with_points(self) -> list[Self]:
        """Filters the list of family members (generated by :meth:`.get_family`) to include only mobjects with points.

        Returns
        -------
        list
            A list of mobjects that have points.

        Examples
        --------
        ::

            >>> from manim import Square, Rectangle, VGroup, Group, Mobject, VMobject
            >>> s, r, m, v = Square(), Rectangle(), Mobject(), VMobject()
            >>> vg = VGroup(s, r)
            >>> gr = Group(vg, m, v)
            >>> gr.family_members_with_points()
            [Square, Rectangle]

        See also
        --------
        :meth:`~.Mobject.get_family`

        """
        return [m for m in self.get_family() if m.get_num_points() > 0]

    def arrange(
        self,
        direction: Vector3D = RIGHT,
        buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFFER,
        center: bool = True,

Review comment (suggestion):
Could it be, instead,
```suggestion
        list[Mobject]
```
?

_EDIT: I just noticed that `.get_family()` also has a return type of `list` in its docstring. It would be cool if both of them were `list[Mobject]`._

Code after:
        Examples
        --------
        ::

            >>> from manim import Square, Rectangle, VGroup, Group, Mobject, VMobject
            >>> s, r, m, v = Square(), Rectangle(), Mobject(), VMobject()
            >>> vg = VGroup(s, r)
            >>> gr = Group(vg, m, v)
            >>> gr.get_family()
            [Group, VGroup(Square, Rectangle), Square, Rectangle, Mobject, VMobject]

        See also
        --------
        :meth:`~.Mobject.family_members_with_points`, :meth:`~.Mobject.align_data`

        """
        sub_families = [x.get_family() for x in self.submobjects]
        all_mobjects = [self] + list(it.chain(*sub_families))
        return remove_list_redundancies(all_mobjects)

    def family_members_with_points(self) -> list[Self]:
        """Filters the list of family members (generated by :meth:`.get_family`) to include only mobjects with points.

        Returns
        -------
        list[Mobject]
            A list of mobjects that have points.

        Examples
        --------
        ::

            >>> from manim import Square, Rectangle, VGroup, Group, Mobject, VMobject
            >>> s, r, m, v = Square(), Rectangle(), Mobject(), VMobject()
            >>> vg = VGroup(s, r)
            >>> gr = Group(vg, m, v)
            >>> gr.family_members_with_points()
            [Square, Rectangle]

        See also
        --------
        :meth:`~.Mobject.get_family`

        """
        return [m for m in self.get_family() if m.get_num_points() > 0]

    def arrange(
        self,
        direction: Vector3D = RIGHT,
        buff: float = DEFAULT_MOBJECT_TO_MOBJECT_BUFFER,
        center: bool = True,