摘要: Python基础知识(19):面向对象高级编程(Ⅱ) 定制类 形如“__xx__”的变量或函数在Python中是有特殊用途的 1、__str__ 让打印出来的结果更好看 __str__:面向用户;__repr__:面向程序员 2、__iter__ 使一个类能够实现for循环的功能 3、__getit 阅读全文
posted @ 2018-12-01 16:45 finsom 阅读(248) 评论(0) 推荐(0)