def is_expression_equal(a, b): if a == b: return True if isinstance(a, p.Expression) or isinstance(b, p.Expression): if a is None or b is None: return False maybe_zero = a - b from pymbolic import distribute d_result = distribute(maybe_zero) return d_result == 0 else: return False
def is_expression_equal(a, b): if a == b: return True from pymbolic.primitives import Expression if isinstance(a, Expression) or isinstance(b, Expression): if a is None or b is None: return False maybe_zero = a - b from pymbolic import distribute d_result = distribute(maybe_zero) return d_result == 0 else: return False