def __delitem__ ( self, key ):
        trait = getattr(self, 'trait', None)
        if trait is None:
            return list.__delitem__(self, key)

        try:
            removed = self[ key ]
        except:
            removed = []

        if isinstance(key,slice):
            key = slice(*key.indices(len( self )))
            slice_len = max(0, (key.stop - key.start) // key.step)
            delta = slice_len
            if key.step == 1:
                # FIXME: See corresponding comment in __setitem__() for
                # explanation.
                index = key.start
            else:
                index = key
                removed = [removed]
        else:
            delta = 1
            index = len( self ) + key + 1 if key < 0 else key
            removed = [ removed ]

        if not (trait.minlen <= (len( self ) - delta)):
            self.len_error( len( self ) - delta)
            return

        list.__delitem__( self, key )

        if self.name_items is not None:
            self._send_trait_items_event( self.name_items,
                TraitListEvent( index, removed ) )
dataset/ETHPy150Open enthought/traits/traits/trait_handlers.py/TraitListObject.__delitem__/original