don't need to implement comparison dunders for Coordinate anymore as it now behaves like a tuple which already includes useful comparators
All checks were successful
Publish to PyPI / Publish to PyPI (push) Successful in 1m11s
All checks were successful
Publish to PyPI / Publish to PyPI (push) Successful in 1m11s
This commit is contained in:
parent
6ab6df1bc9
commit
c2f6191d69
@ -288,30 +288,6 @@ class Coordinate(tuple):
|
||||
def __truediv__(self, other):
|
||||
return self // other
|
||||
|
||||
def __gt__(self, other):
|
||||
if self.z is None:
|
||||
return self.x > other.x and self.y > other.y
|
||||
else:
|
||||
return self.x > other.x and self.y > other.y and self.z > other.z
|
||||
|
||||
def __ge__(self, other):
|
||||
if self.z is None:
|
||||
return self.x >= other.x and self.y >= other.y
|
||||
else:
|
||||
return self.x >= other.x and self.y >= other.y and self.z >= other.z
|
||||
|
||||
def __lt__(self, other):
|
||||
if self.z is None:
|
||||
return self.x < other.x and self.y < other.y
|
||||
else:
|
||||
return self.x < other.x and self.y < other.y and self.z < other.z
|
||||
|
||||
def __le__(self, other):
|
||||
if self.z is None:
|
||||
return self.x <= other.x and self.y <= other.y
|
||||
else:
|
||||
return self.x <= other.x and self.y <= other.y and self.z <= other.z
|
||||
|
||||
def __str__(self):
|
||||
if self.z is None:
|
||||
return "(%d,%d)" % (self.x, self.y)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user