python 面向对象高级编程
摘要:
#**********使用__slots__限制实例属性********** class Student(object): pass def set_age(self,age): self.age = age from types import MethodType s = Student() s.set_age = MethodType(set_age,s) #给实例绑定一... 阅读全文
posted @ 2018-06-20 20:04 afly666 阅读(194) 评论(0) 推荐(0) 编辑