
class Rectangle:

    def __init__(self, l, w):

        if l > 0:
            self.__length = l
        else:
            self.__length = 1

        if w > 0:
            self.__width = w
        else:
            self.__width = 1


    def get_length(self):
        return self.__length

    def get_width(self):
        return self.__width

    def set_length(self, l):
        if l > 0:
            self.__length = l

    def set_width(self, w):
        if w > 0:
            self.__width = w

    # if r1, and r2 are both rectangles we call this method like
    # if r1 == r2:
    # r1 goes into self
    # r2 goes into rhs
    def __eq__(self, rhs):
        if self.__length == rhs.__length and \
           self.__width == rhs.__width:
            return True
        else:
            return False

##        return self.__length == rhs.__length and \
##           self.__width == rhs.__width
        
    def __str__(self):
        return 'A rectangle of length ' + str(self.__length) + \
               ' and width ' + str(self.__width) + '.'
