摘要: __str__和__repr__ print(obj) 或 "s%" % obj 或 str(obj) 的时候,实际上是调用了__str__方法,返回的是一个字符串 class Foo(object): def __str__(self): return "__str__" def __repr__ 阅读全文
posted @ 2018-09-18 18:02 就俗人一个 阅读(172) 评论(0) 推荐(0) 编辑