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

Code before:
        Duplicates are not added again::

            >>> outer = outer.add(inner)
            >>> len(outer.submobjects)
            1

        Adding an object to itself raises an error::

            >>> outer.add(outer)
            Traceback (most recent call last):
            ...
            ValueError: Mobject cannot contain self

        """
        for m in mobjects:
            if not isinstance(m, Mobject):
                raise TypeError("All submobjects must be of type Mobject")
            if m is self:
                raise ValueError("Mobject cannot contain self")
        self.submobjects = list_update(self.submobjects, mobjects)
        return self

    def add_to_back(self, *mobjects):
        """Adds (or moves) all *mobjects to the head of the self.submobjects list.
        The head of the list is rendered first - i.e. at the back of the scene.
        """
        self.remove(*mobjects)
        self.submobjects = list(mobjects) + self.submobjects
        return self

    def remove(self, *mobjects):
        """Remove submobjects.

        The mobjects are removed from self.submobjects, if they exist.

        Parameters
        ----------
        mobjects : :class:`Mobject`
            The mobjects to remove.

        Returns
        -------
        :class:`Mobject`
            :code:`self`

        See Also
        --------
        :meth:`~Mobject.add`

        """
        for mobject in mobjects:

Review comment (suggestion):
Oneline descriptions should be a bit shorter, technical explanations can come afterwards.

```suggestion
        """Adds (or moves) all passed mobjects to the back of the scene.
        
        .. note::

            Technically, this is done by adding (or moving) the mobjects to
            the head of ``self.submobjects``. The head of this list is rendered
            first, which places the corresponding mobjects behind the
            subsequent list members.
        """
```

Code after:
        Duplicates are not added again::

            >>> outer = outer.add(inner)
            >>> len(outer.submobjects)
            1

        Adding an object to itself raises an error::

            >>> outer.add(outer)
            Traceback (most recent call last):
            ...
            ValueError: Mobject cannot contain self

        """
        for m in mobjects:
            if not isinstance(m, Mobject):
                raise TypeError("All submobjects must be of type Mobject")
            if m is self:
                raise ValueError("Mobject cannot contain self")
        self.submobjects = list_update(self.submobjects, mobjects)
        return self

    def add_to_back(self, *mobjects):
        """Adds (or moves) all passed mobjects to the back of the scene.

        .. note::

            Technically, this is done by adding (or moving) the mobjects to
            the head of ``self.submobjects``. The head of this list is rendered
            first, which places the corresponding mobjects behind the
            subsequent list members.
        """
        self.remove(*mobjects)
        self.submobjects = list(mobjects) + self.submobjects
        return self

    def remove(self, *mobjects):
        """Remove submobjects.

        The mobjects are removed from self.submobjects, if they exist.

        Parameters
        ----------
        mobjects : :class:`Mobject`
            The mobjects to remove.

        Returns
        -------
        :class:`Mobject`
            :code:`self`