If a class defines it, this method is called whenever a new value is stored into a sequence or mapping (dictionary-like object), such as in statements of this form:
Here is the calling sequence:
def __setitem__(self, i, value): ...
For sequence-type objects, the
argument specifies the position in the sequence to be
modified. For mappings, the
is the key under which the
value is to