In fact about @property I searched a lot of tutorials to see, because the company used a lot of OOP programming and I have rarely written before, so now to re-fill.
The most obvious difference between the use and the @property is that
classStudent (object):defGet_score (self):returnSelf._scoredefSet_score (self, value):if notisinstance (value, int):RaiseValueError ('score must is an integer!') ifValue < 0orValue > 100: RaiseValueError ('score must between 0 ~ 100!') Self._score=value#instantiate the Student classx =Student ()#calling the Get_score methodX.get_score () But if you add @property, then X.get_score can run.
This is probably my most obvious and intuitive feeling for @property.
There are many other features that can be used after using @property.
For details, refer to Http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/ 001386820062641f3bcc60a4b164f8d91df476445697b9e000
Liaoche Teacher's tutorial.
Summarizing and thinking about the @property of Python