- 博客(1)
- 收藏
- 关注
转载 【笔记】:python之@property的使用
python之@property的使用 很多时候我们需要对一个对象设置某个属性和获取某个属性的时候,我们一般会写一个"set"的方法和“get”的方法,但是这样写起来不友好,使用起来不方便,如下代码所示: class Student(object): def set_score(self, score): if not isinstance(score, int): ...
2019-12-17 23:00:04
132
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人