摘要: 定义在class中不需要直接调用,python的某些函数或操作符会自动的调用对应的特殊方法. 1、python中 __str__和__repr__ __str__()用于显示给用户,而__repr__()用于显示给开发人员。__str__是可打印的字符输出,内建str()及print语句 2、pyt 阅读全文
posted @ 2018-03-16 16:51 xajh00789 阅读(283) 评论(0) 推荐(0)