Add unary minus for TupleCoords

This commit is contained in:
Salad Dais
2022-06-19 04:33:20 +00:00
parent 5b51dbd30f
commit bbc8813b61

View File

@@ -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)))