标签:value nbsp integer view instance toc obj 表示 友好
@property可以将python定义的函数“当做”属性访问,从而提供更加友好访问方式,但是有时候setter/deleter也是需要的。
1》只有@property表示只读。
2》同时有@property和@x.setter表示可读可写。
3》同时有@property和@x.setter和@x.deleter表示可读可写可删除。
运行结果:
60
100
123456
@property和@x.setter和@x.deleter表示可读可写可删除
标签:value nbsp integer view instance toc obj 表示 友好
原文地址:http://www.cnblogs.com/howhy/p/7158007.html