Understanding __get__ and __set__ and Python descriptors
The descriptor is how Python’s property type is implemented. A descriptor simply implements __get__, __set__, etc. and is then added to another class in its definition (as you did above with the Temperature class). For example: temp=Temperature() temp.celsius #calls celsius.__get__ Accessing the property you assigned the descriptor to (celsius in the above example) calls the … Read more