(self, key)
>>> 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)])
>>> 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)])
>>> 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):
        """
        >>> 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)])
        """
        if isinstance(key, types.SliceType):
            # FIXME: efficiency?
            keys = self._sequence[key]
            for entry in keys:
                dict.__delitem__(self, entry)
            del self._sequence[key]
        else:
            # do the dict.__delitem__ *first* as it raises
            # the more appropriate error
            dict.__delitem__(self, key)
            self._sequence.remove(key)
def __delitem__ ( self , key ) : if isinstance ( key , types . SliceType ) : # FIXME: efficiency? keys = self . _sequence [ key ] for entry in keys : dict . __delitem__ ( self , entry ) del self . _sequence [ key ] else : # do the dict.__delitem__ *first* as it raises # the more appropriate error dict . __delitem__ ( self , key ) self . _sequence . remove ( key )