"""
subclass Square of Shape
"""


from shape import Shape
from point import Point


class Square(Shape):
    """
    A Square; extends Shape
    """

    def __init__(self, corners):
        """
        Create Square self with corners.

        Assume all sides are equal and corners are square.

        Extends Shape (adds to documentation).

        @param Square self: this Square object
        @param list[Point] corners: corners that define this Square
        @rtype: None

        >>> s = Square([Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 1)])
        """
        Shape.__init__(self, corners)

    def _get_area(self):
        # """
        # Blah, blah, blah!!!"""
        # over-rides Shape._get_area()
        return self.corners[0].distance(self.corners[1]) ** 2

    area = property(_get_area)

if __name__ == '__main__':
    import doctest
    doctest.testmod()
    s = Square([Point(0, 0), Point(100, 0), Point(100, 100), Point(0, 100)])
    s.draw()
    print(s.area)
    print(s.perimeter)
    # Pycharm flags these,
    # as it should.
    # print(s.corners + "three")
    # print(s.area + "three")
