'Compare this :class:`BinaryExpression` against the
given :class:`BinaryExpression`.'

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

    return (isinstance(other, BinaryExpression) and (self.operator == other.operator) and ((self.left.compare(other.left, **kw) and self.right.compare(other.right, **kw)) or (operators.is_commutative(self.operator) and self.left.compare(other.right, **kw) and self.right.compare(other.left, **kw))))
