def __setitem__(self, index, value):

        try:
            self._v[index] = 1.0 * value
        except IndexError:
            raise IndexError("There are 3 values in this object, index should be 0, 1 or 2!")
        except TypeError:
            raise TypeError("Must be a number")
Sets a component, given its index.
dataset/ETHPy150Open PythonProgramming/Beginning-Game-Development-with-Python-and-Pygame/Chapter 10/gameobjects/vector3.py/Vector3.__setitem__