def __delitem__(self, item):
        """
        By default Redis treats deletes as delete by value, as
        opposed to delete by index. If an integer is passed into the
        function, it will be treated as an index, otherwise it will
        be treated as a value.

        If a slice is passed, then the list will be trimmed so that it *ONLY*
        contains the range specified by the slice start and stop. Note that
        this differs from the default behavior of Python's `list` type.
        """
        if isinstance(item, slice):
            start = item.start or 0
            stop = item.stop or -1
            if stop > 0:
                stop -= 1
            return self.database.ltrim(self.key, start, stop)
        elif isinstance(item, int):
            item = self[item]
            if item is None:
                return
        return self.database.lrem(self.key, 1, item)
def __delitem__ ( self , item ) : if isinstance ( item , slice ) : start = item . start or 0 stop = item . stop or - 1 if stop > 0 : stop -= 1 return self . database . ltrim ( self . key , start , stop ) elif isinstance ( item , int ) : item = self [ item ] if item is None : return return self . database . lrem ( self . key , 1 , item )
By default Redis treats deletes as delete by value, as
        opposed to delete by index. If an integer is passed into the
        function, it will be treated as an index, otherwise it will
        be treated as a value.

        If a slice is passed, then the list will be trimmed so that it *ONLY*
        contains the range specified by the slice start and stop. Note that
        this differs from the default behavior of Python's `list` type.