#NEWLINE# def __delitem__( self , item ) : #NEWLINE# #INDENT# '\n        By default Redis treats deletes as delete by value, as\n        opposed to delete by index. If an integer is passed into the\n        function, it will be treated as an index, otherwise it will\n        be treated as a value.\n        ' #NEWLINE# if isinstance ( item , slice ) : #NEWLINE# #INDENT# start = ( item . start or 0 ) #NEWLINE# stop = ( item . stop or ( - 1 ) ) #NEWLINE# if ( stop > 0 ) : #NEWLINE# #INDENT# stop -= 1 #NEWLINE# #UNINDENT# return self . database . ltrim ( self . key , start , stop ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( item , int ) : #NEWLINE# #INDENT# item = self [ item ] #NEWLINE# if ( item is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return self . database . lrem ( self . key , item )