我们可以更改类字符串的输出吗?注意:我说的是不是实例的课程
例如:
class Foo(object):
baz=10
def __init__(self,value):
self.value=value
def bar(self):
self.a="3llo world"
def __str__(self):
return "not me"
def __repr__(self):
return "not me either"
print Foo
输出:
<class '__main__.Foo'>
输出来自哪里?感谢