24 lines
535 B
Python
24 lines
535 B
Python
class Point:
|
|
def __init__(self, x, y):
|
|
self.x = x
|
|
self.y = y
|
|
|
|
def getY(self):
|
|
return self.y
|
|
|
|
def getX(self):
|
|
return self.x
|
|
|
|
def __hash__(self):
|
|
"""Overrides the default implementation"""
|
|
return hash(tuple(sorted(self.__dict__.items())))
|
|
|
|
def __eq__(self, other):
|
|
if isinstance(other, self.__class__):
|
|
return self.__dict__ == other.__dict__
|
|
else:
|
|
return False
|
|
|
|
def __ne__(self, other):
|
|
return not self.__eq__(other)
|