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

Code before:
                    self.wait(0.5)
        """
        self.align_data(mobject)
        for sm1, sm2 in zip(self.get_family(), mobject.get_family()):
            sm1.points = np.array(sm2.points)
        return self

    # Errors
    def throw_error_if_no_points(self):
        if config.renderer == "opengl":
            if len(self.data["points"]) == 0:
                caller_name = sys._getframe(1).f_code.co_name
                raise Exception(
                    f"Cannot call Mobject.{caller_name} for a Mobject with no points"
                )
        else:
            if self.has_no_points():
                caller_name = sys._getframe(1).f_code.co_name
                raise Exception(
                    f"Cannot call Mobject.{caller_name} for a Mobject with no points"
                )

    # About z-index
    def set_z_index(
        self,
        z_index_value: Union[int, float],
        family: bool = True,
    ) -> "VMobject":
        """Sets the :class:`~.Mobject`'s :attr:`z_index` to the value specified in `z_index_value`.

        Parameters
        ----------
        z_index_value
            The new value of :attr:`z_index` set.
        family
            If ``True``, the :attr:`z_index` value of all submobjects is also set.

        Returns
        -------
        :class:`Mobject`
            The Mobject itself, after :attr:`z_index` is set. For chaining purposes. (Returns `self`.)

        Examples
        --------
        .. manim:: SetZIndex
            :save_last_frame:

            class SetZIndex(Scene):
                def construct(self):
                    text = Text('z_index = 3', color = PURE_RED).shift(UP).set_z_index(3)
                    square = Square(2, fill_opacity=1).set_z_index(2)

Review comment (suggestion):
Just `float` is fine here.
```suggestion
        z_index_value: float,
```

Code after:
                    self.wait(0.5)
        """
        self.align_data(mobject)
        for sm1, sm2 in zip(self.get_family(), mobject.get_family()):
            sm1.points = np.array(sm2.points)
        return self

    # Errors
    def throw_error_if_no_points(self):
        if config.renderer == "opengl":
            if len(self.data["points"]) == 0:
                caller_name = sys._getframe(1).f_code.co_name
                raise Exception(
                    f"Cannot call Mobject.{caller_name} for a Mobject with no points"
                )
        else:
            if self.has_no_points():
                caller_name = sys._getframe(1).f_code.co_name
                raise Exception(
                    f"Cannot call Mobject.{caller_name} for a Mobject with no points"
                )

    # About z-index
    def set_z_index(
        self,
        z_index_value: float,
        family: bool = True,
    ) -> "VMobject":
        """Sets the :class:`~.Mobject`'s :attr:`z_index` to the value specified in `z_index_value`.

        Parameters
        ----------
        z_index_value
            The new value of :attr:`z_index` set.
        family
            If ``True``, the :attr:`z_index` value of all submobjects is also set.

        Returns
        -------
        :class:`Mobject`
            The Mobject itself, after :attr:`z_index` is set. For chaining purposes. (Returns `self`.)

        Examples
        --------
        .. manim:: SetZIndex
            :save_last_frame:

            class SetZIndex(Scene):
                def construct(self):
                    text = Text('z_index = 3', color = PURE_RED).shift(UP).set_z_index(3)
                    square = Square(2, fill_opacity=1).set_z_index(2)