cryptotools/Cryptotools/Groups/point.py

35 lines
652 B
Python

#!/usr/bin/env python3
class Point:
"""
This simple class represent the Point at the coordinate x and y in a plan
Attributes:
x (Integer): Position at the x
y (Integer): Position at the y
"""
def __init__(self, x, y):
self._x = x
self._y = y
@property
def x(self):
return self._x
@property
def y(self):
return self._y
@x.setter
def x(self, x):
self._x = x
@y.setter
def y(self, y):
self._y = y
def __eq__(self, other):
print(self._x, other.x)
return self._x == other.x and self._y == other.y