Replaces the specified element with the element at the specified position in this list.

        :param index: (int), index of the item to be replaced.
        :param item: (object), item to be stored.
        :return: (object), the previous item in the specified index.

def set_at(self, index, item):
        """
        Replaces the specified element with the element at the specified position in this list.

        :param index: (int), index of the item to be replaced.
        :param item: (object), item to be stored.
        :return: (object), the previous item in the specified index.
        """
        check_not_none(item, "Value can't be None")
        element_data = self._to_data(item)
        return self._encode_invoke(list_set_codec, index=index, value=element_data)