2016年6月17日

定制类

摘要: class Student(object): pass s = Student() s.name = 'Michael' print(s.name) def set_age(self, age): self.age = age from types import MethodType s.set_age = MethodType(set_age, s) #给实例绑定一个方法 s... 阅读全文

posted @ 2016-06-17 22:21 张明明_1 阅读(205) 评论(0) 推荐(0)

slots

摘要: class Student(object): pass s = Student() s.name = 'Michael' print(s.name) def set_age(self, age): self.age = age from types import MethodType s.set_age = MethodType(set_age, s) #给实例绑定一个方法 s... 阅读全文

posted @ 2016-06-17 19:38 张明明_1 阅读(705) 评论(0) 推荐(0)

面向对象

摘要: 练习的代码 阅读全文

posted @ 2016-06-17 09:48 张明明_1 阅读(185) 评论(0) 推荐(0)

导航