Objective:
Provides something similar to Getter/setter in Java.
(The purpose of getter/setter: To make attributes more simple by making them easier to reference---especially for future read/assignment of properties)
Official Concise document:
Https://docs.python.org/2/howto/descriptor.html
Good introduction to English (details of the ins and outs):
http://martyalchin.com/2007/nov/23/python-descriptors-part-1-of-2/
Profile:
1. Method of implementing attributes/variables
2. Python's handling is slightly strange (implemented by an external Descripter class), but it's not surprising.
3. Since the reference class is not allowed to be modified at run time, only the __get__ function has a reference class (Reffer_obj_type) parameter passed in
def __get__ (self, Refer_obj, Refer_obj_type): Pass
4. An instance of the Descripter class, (Beginner's mind) is best referred to by its class invocation, rather than by the instance of the referenced person.
However, there is nothing wrong with invoking it on the instance of the referrer (the Refer_obj parameter is not none at this time)
Python __get__ & __set__