# Step 1
class Point:
    """ A 2-dimensional point
    """

    # always (or at least almost always)
    # start with __init__ to set up a new object
    # __str__ for you in debugging
    # __eq__ so we can compare things

    def __init__(self, x, y):
        """ Create a new Point object that is x
        units to the right of the origin and
        y units above the origin.

        @type self: Point
        @type x: float | int # float OR int
        @type y: float | int
        @rtype: None
        """


    def __eq__(self, other):
        """ Return whether this Point is the
        same as other.

        @type self: Point
        @type other: Point | Any
        @rtype: bool
        """

        # we want to be able to compare a Point
        # object to anything
        # Point(1, 1) == ['cat']

        # if we assume other is a Point
        return self.x == other.x and \
            self.y == other.y
        # but other.x will produce an error
        # if the object other does not have
        # an attribute x

        return type(self) == type(other) and \
            self.x == other.x and \
            self.y == other.y



    def __str__(self):
        """ Return a readable string
        representation of this Point.

        @self: Point
        @rtype: str
        """


# Step 2 - client code
if __name__ == '__main__':
    p1 = Point(5, 2)
    p1.distance_to_origin()
    p2 = Point(3, 3)
    p1.distance(p2)
    p1.move(1, 1)
    p1.midpoint(p2)
    p1 == p2