From 0e7eabca25796475d17fd7b98d7f577ae5c3159b Mon Sep 17 00:00:00 2001 From: Michael Schneeberger Date: Tue, 6 Dec 2022 13:06:39 +0100 Subject: use dataclass __eq__ method --- polymatrix/expression/impl/cacheexprimpl.py | 3 ++- polymatrix/expression/impl/parametrizeexprimpl.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/polymatrix/expression/impl/cacheexprimpl.py b/polymatrix/expression/impl/cacheexprimpl.py index f6e45d3..4ca4bf2 100644 --- a/polymatrix/expression/impl/cacheexprimpl.py +++ b/polymatrix/expression/impl/cacheexprimpl.py @@ -3,6 +3,7 @@ from polymatrix.expression.cacheexpr import CacheExpr from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin -@dataclass_abc.dataclass_abc(frozen=True, eq=False) +# @dataclass_abc.dataclass_abc(frozen=True, eq=False) +@dataclass_abc.dataclass_abc(frozen=True) class CacheExprImpl(CacheExpr): underlying: ExpressionBaseMixin diff --git a/polymatrix/expression/impl/parametrizeexprimpl.py b/polymatrix/expression/impl/parametrizeexprimpl.py index 3accf0c..4278a68 100644 --- a/polymatrix/expression/impl/parametrizeexprimpl.py +++ b/polymatrix/expression/impl/parametrizeexprimpl.py @@ -3,10 +3,17 @@ from polymatrix.expression.parametrizeexpr import ParametrizeExpr from polymatrix.expression.mixins.expressionbasemixin import ExpressionBaseMixin -@dataclass_abc.dataclass_abc(frozen=True, eq=False, repr=False) +# @dataclass_abc.dataclass_abc(frozen=True, eq=False, repr=False) +@dataclass_abc.dataclass_abc(frozen=True, repr=False) class ParametrizeExprImpl(ParametrizeExpr): underlying: ExpressionBaseMixin name: str def __repr__(self) -> str: return f'{self.__class__.__name__}(name={repr(self.name)})' + + # def __eq__(self, other: object) -> bool: + # return self.name == other.name + + # def __hash__(self) -> bool: + # return hash(self.name) -- cgit v1.2.1