2016年10月28日

摘要: 空类 Michael 创建实例,绑定name属性 绑定前,先定义方法 set_age 引入 MethodType 给实例s绑定set_age方法 调用方法 看结果 当然,再创建个新实例,是没有这个绑定关系的。 想给所有实例一次绑定,就给类绑定方法。 阅读全文
posted @ 2016-10-28 12:23 chinxfin 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Traceback (most recent call last): File "<stdin>", line 1, in <module>AttributeError: 'Student' object has no attribute 'score' 由于'score'没有被放到__slots_ 阅读全文
posted @ 2016-10-28 10:46 chinxfin 阅读(83) 评论(0) 推荐(0) 编辑

导航