    def __setitem__(self, index: str | int, value: ErrorTree):
        """
        Add an error to the tree at the given ``index``.

        .. deprecated:: v4.20.0

            Setting items on an `ErrorTree` is deprecated without replacement.
            To populate a tree, provide all of its sub-errors when you
            construct the tree.
        """
        warnings.warn(
            "ErrorTree.__setitem__ is deprecated without replacement.",
            DeprecationWarning,
            stacklevel=2,
        )
        self._contents[index] = value  # type: ignore[index]
Add an error to the tree at the given ``index``.

.. deprecated:: v4.20.0

Setting items on an `ErrorTree` is deprecated without replacement.
To populate a tree, provide all of its sub-errors when you
construct the tree.
jsonschema/exceptions.py