- 博客(1)
- 收藏
- 关注
原创 python3 MethodType方法简解
class Student(object): pass def set_score(self, score): … self.score = score … Student.set_score = MethodType(set_score, Student) s.set_score(100) s.score 100 给 class 绑定方法后,也就是说定义class的变量同样可...
2019-02-17 18:15:53
305
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人