NEW: Coordinate().__mod__()

This commit is contained in:
Stefan Harmuth 2023-12-22 05:55:29 +01:00
parent fb3bef0153
commit 14d535911c

View File

@ -290,6 +290,12 @@ class Coordinate(tuple):
else:
return self.__class__(self[0] * other, self[1] * other, self[2] * other)
def __mod__(self, other: int) -> Coordinate:
if self[2] is None:
return self.__class__(self[0] % other, self[1] % other)
else:
return self.__class__(self[0] % other, self[1] % other, self[2] % other)
def __floordiv__(self, other: int | float) -> Coordinate:
if self[2] is None:
return self.__class__(self[0] // other, self[1] // other)