From f45cecdf3afe6997b44aa49c506cefcd180c97a7 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Thu, 3 Nov 2011 20:55:16 -0500 Subject: [PATCH] Implement is_equal on FloorDiv. --- pymbolic/primitives.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pymbolic/primitives.py b/pymbolic/primitives.py index 825ebd1..889611e 100644 --- a/pymbolic/primitives.py +++ b/pymbolic/primitives.py @@ -498,6 +498,11 @@ class Quotient(QuotientBase): class FloorDiv(QuotientBase): + def is_equal(self, other): + return isinstance(other, type(self)) \ + and (self.numerator == other.numerator) \ + and (self.denominator == other.denominator) + mapper_method = intern("map_floor_div") @@ -505,7 +510,6 @@ class FloorDiv(QuotientBase): class Remainder(QuotientBase): def is_equal(self, other): - from pymbolic.rational import Rational return self.__class__ == other.__class__ \ and (self.numerator == other.numerator) \ and (self.denominator == other.denominator) -- GitLab