(self, index, item)
Set item at position i to item.
Set item at position i to item.
Set item at position i to item .
def __setitem__(self, index, item):
        """Set item at position i to item."""
        if isinstance(index, types.SliceType):
            # NOTE: item must be an iterable (list of tuples)
            self._main[index] = OrderedDict(item)
        else:
            # FIXME: Does this raise a sensible error?
            orig = self._main.keys[index]
            key, value = item
            if self._main.strict and key in self and (key != orig):
                raise ValueError('slice assignment must be from '
                        'unique keys')
            # delete the current one
            del self._main[self._main._sequence[index]]
            self._main.insert(index, key, value)
def __setitem__ ( self , index , item ) : if isinstance ( index , types . SliceType ) : # NOTE: item must be an iterable (list of tuples) self . _main [ index ] = OrderedDict ( item ) else : # FIXME: Does this raise a sensible error? orig = self . _main . keys [ index ] key , value = item if self . _main . strict and key in self and ( key != orig ) : raise ValueError ( 'slice assignment must be from ' 'unique keys' ) # delete the current one del self . _main [ self . _main . _sequence [ index ] ] self . _main . insert ( index , key , value )