Skip to content

Commit f3f24f2

Browse files
committed
also check cse.get_extra_properties
1 parent 7f0b140 commit f3f24f2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pymbolic/mapper/equality.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ def map_common_subexpression(self, expr, other) -> bool:
213213
return (
214214
expr.prefix == other.prefix
215215
and expr.scope == other.scope
216-
and self.rec(expr.child, other.child))
216+
and self.rec(expr.child, other.child)
217+
and all(k == other_k and v == other_v
218+
for (k, v), (other_k, other_v) in zip(
219+
expr.get_extra_properties(),
220+
other.get_extra_properties())))
217221

218222
def map_substitution(self, expr, other) -> bool:
219223
return (

pymbolic/primitives.py

-6
Original file line numberDiff line numberDiff line change
@@ -996,12 +996,6 @@ class Quotient(QuotientBase):
996996
.. attribute:: denominator
997997
"""
998998

999-
def is_equal(self, other):
1000-
from pymbolic.rational import Rational
1001-
return isinstance(other, (Rational, Quotient)) \
1002-
and (self.numerator == other.numerator) \
1003-
and (self.denominator == other.denominator)
1004-
1005999
mapper_method = intern("map_quotient")
10061000

10071001

0 commit comments

Comments
 (0)