notedescriptors can not be invoked if __getattribute__ method is used in the class as shown in above example we need to find some other ways in such cases use more than one instance for testing following is the good examplewhich shows that test must be performed on more than one object of classes as following codewill work fine for one objectbut error can be caught with two or more objects only examples py class descriptorclassstorage(object)""descriptor example ""def __init__(selfdefault none)self value default def __get__(selfinstancecls)return self value def __set__(selfinstancevalue)self value value class storeclass(object)attr descriptorclassstorage( store store storeclass(storeclass(print(store attrstore attr store attr print(store attrstore attr in above codeonly store attr is set to but value of store attr is also changes this is happening becausein data-descriptors values are stored in descriptors only (not in instance dictionary as mentioned in previous sectionexamples write descriptor which allows only positive values following is the code to test the positive number using descriptorpositivevaluedescriptor py class positivevalueonly(object)""allows only positive values ""def __init__(self)self value def __get__(selfinstancecls)return self value def __set__(selfinstancevalue)if value raise valueerror ('only positive values can be used'else(continues on next page descriptors