'Compare this :class:`.ClauseList` to the given :class:`.ClauseList`,
including a comparison of all the clause items.'

def compare(self, other, **kw):

    if ((not isinstance(other, ClauseList)) and (len(self.clauses) == 1)):
        return self.clauses[0].compare(other, **kw)
    elif (isinstance(other, ClauseList) and (len(self.clauses) == len(other.clauses))):
        for i in range(0, len(self.clauses)):
            if (not self.clauses[i].compare(other.clauses[i], **kw)):
                return False
        else:
            return (self.operator == other.operator)
    else:
        return False
