摘要: 为什么使用self? class One: def prt(self): print(123) t = One() t.prt() t.prt()和t.prt(t)输出结果是一样的. 当我们调用t.prt()时,实际上Python解释成One.prt(t),所有需要参数来接收实例. self可以换成 阅读全文
posted @ 2017-01-13 17:36 Dus 阅读(1067) 评论(0) 推荐(0) 编辑