explanation listing hereclass integer is used to verify the type of the attributes using '__get__and '__set__at lines and respectively the class 'rectis calling the class 'integerat lines and the name of the attribute is passed in these lineswhose values are set by the integer class in the form of dictionaries at line alsovalue is get from the dictionary from line note thatin this caseonly one line is added for each attributewhich removes the problem of '@propertymethod listing attribute validation using descriptor rectdescriptor py class integerdef __init__(selfparameter)self parameter parameter def __get__(selfinstancecls)if instance is nonerequired if descriptor is return self used as class variable elsein this codeonly following line is required return instance __dict__[self parameter def __set__(selfinstancevalue)print("setting % to % (self parametervalue)if not isinstance(valueint)raise typeerror("interger value is expected"instance __dict__[self parametervalue class rectlength integer('length'width integer('width'def __init__(selflengthwidth)self length length self width width def area(self)'''calculates arealength*width''return self length self width rect( , #setting length to #setting width to print( length print("area:"rect area( )area # rect( #typeerrorinterger value is expected generalized validation in this sectiondecorators and descriptors are combined to create validationwhere attribute-types are defined by the individual class authors notenote thatvarious types '@typeassert(author=strlength=intwidth=float)will be defined by class author for validation explanation listing in this codefirst decorator 'typeassertis applied to class 'rectat line the typeassert contains generalized attribute validation