directly unlike propertiesdescriptors are broader in scopeand provide more general tool for instancebecause they are coded as normal classesdescriptors have their own statemay participate in descriptor inheritance hierarchiescan use composition to aggregate objectsand provide natural structure for coding internal methods and attribute documentation strings the basics as mentioned previouslydescriptors are coded as separate classes and provide specially named accessor methods for the attribute access operations they wish to intercept --getsetand deletion methods in the descriptor class are automatically run when the attribute assigned to the descriptor class instance is accessed in the corresponding wayclass descriptor"docstring goes heredef __get__(selfinstanceowner)def __set__(selfinstancevalue)def __delete__(selfinstance)return attr value return nothing (nonereturn nothing (noneclasses with any of these methods are considered descriptorsand their methods are special when one of their instances is assigned to another class' attribute--when the attribute is accessedthey are automatically invoked if any of these methods are absentit generally means that the corresponding type of access is not supported unlike propertieshoweveromitting __set__ allows the descriptor attribute' name to be assigned and thus redefined in an instancethereby hiding the descriptor--to make an attribute read-onlyyou must define __set__ to catch assignments and raise an exception descriptors with __set__ methods also have some special-case implications for inheritance that we'll largely defer until ' coverage of metaclasses and the complete inheritance specification in shorta descriptor with __set__ is known formally as data descriptorand is given precedence over other names located by normal inheritance rules the inherited descriptor for name __class__for exampleoverrides the same name in an instance' namespace dictionary this also works to ensure that data descriptors you code in your own classes take precedence over others descriptor method arguments before we code anything realisticlet' take brief look at some fundamentals all three descriptor methods outlined in the prior section are passed both the descriptor class instance (self)and the instance of the client class to which the descriptor instance is attached (instancethe __get__ access method additionally receives an owner argumentspecifying the class to which the descriptor instance is attached its instance argument is either the instance through which the attribute was accessed (for instance attr)or none when the atdescriptors