'>>> d = OrderedDict(((1, 3), (3, 2), (2, 1)))
>>> del d[3]
>>> d
OrderedDict([(1, 3), (2, 1)])
>>> del d[3]
Traceback (most recent call last):
KeyError: 3
>>> d[3] = 2
>>> d
OrderedDict([(1, 3), (2, 1), (3, 2)])
>>> del d[0:1]
>>> d
OrderedDict([(2, 1), (3, 2)])'

def __delitem__(self, key):

    if isinstance(key, types.SliceType):
        keys = self._sequence[key]
        for entry in keys:
            dict.__delitem__(self, entry)
        del self._sequence[key]
    else:
        dict.__delitem__(self, key)
        self._sequence.remove(key)
