#NEWLINE# def __sub__( self , other ) : #NEWLINE# #INDENT# " Subtract count, but keep only results with positive counts.\n\n        >>> Counter('abbbc') - Counter('bccd')\n        Counter({'b': 2, 'a': 1})\n\n        " #NEWLINE# if ( not isinstance ( other , Counter ) ) : #NEWLINE# #INDENT# return NotImplemented #NEWLINE# #UNINDENT# result = Counter ( ) #NEWLINE# for elem in ( set ( self ) | set ( other ) ) : #NEWLINE# #INDENT# newcount = ( self [ elem ] - other [ elem ] ) #NEWLINE# if ( newcount > 0 ) : #NEWLINE# #INDENT# result [ elem ] = newcount #NEWLINE# #UNINDENT# #UNINDENT# return result