From bbc8813b61e32e9aa73e99f04c878b26cd85effe Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Sun, 19 Jun 2022 04:33:20 +0000 Subject: [PATCH] Add unary minus for TupleCoords --- hippolyzer/lib/base/datatypes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hippolyzer/lib/base/datatypes.py b/hippolyzer/lib/base/datatypes.py index 2ab7fd3..2631106 100644 --- a/hippolyzer/lib/base/datatypes.py +++ b/hippolyzer/lib/base/datatypes.py @@ -58,6 +58,9 @@ class TupleCoord(recordclass.datatuple, _IterableStub): # type: ignore def __abs__(self): return self.__class__(*(abs(x) for x in self)) + def __neg__(self): + return self.__class__(-x for x in self) + def __add__(self, other): return self.__class__(*(x + y for x, y in zip(self, other)))