diff --git a/pymbolic/primitives.py b/pymbolic/primitives.py index 1b4977a..736ad51 100644 --- a/pymbolic/primitives.py +++ b/pymbolic/primitives.py @@ -478,19 +478,19 @@ def __rmul__(self, other: object) -> Product: return Product((other, self)) def __truediv__(self, other: object) -> Quotient: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return Quotient(self, other) def __rtruediv__(self, other: object) -> Quotient: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return Quotient(other, self) def __floordiv__(self, other: object) -> FloorDiv: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return FloorDiv(self, other) @@ -502,25 +502,25 @@ def __rfloordiv__(self, other: object) -> FloorDiv: return FloorDiv(other, self) def __mod__(self, other: object) -> Remainder: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return Remainder(self, other) def __rmod__(self, other: object) -> Remainder: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return Remainder(other, self) def __pow__(self, other: object) -> Power: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return Power(self, other) def __rpow__(self, other: object) -> Power: - if not is_valid_operand(other): + if not is_arithmetic_expression(other): return NotImplemented return Power(other, self)