diff options
author | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2022-12-06 13:06:39 +0100 |
---|---|---|
committer | Michael Schneeberger <michael.schneeberger@fhnw.ch> | 2022-12-06 13:06:39 +0100 |
commit | 0e7eabca25796475d17fd7b98d7f577ae5c3159b (patch) | |
tree | 1a11de752547bb9c5fd3c79a2edc2c4020423ce3 | |
parent | remove equals function (diff) | |
download | polymatrix-0e7eabca25796475d17fd7b98d7f577ae5c3159b.tar.gz polymatrix-0e7eabca25796475d17fd7b98d7f577ae5c3159b.zip |
use dataclass __eq__ method
-rw-r--r-- | polymatrix/expression/impl/cacheexprimpl.py | 3 | ||||
-rw-r--r-- | 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) |