Python中__repr__和__str__区别详解 看下面的例子就明白了classTest(object):def__init__(self,value='hello,world!'):self.data=value>>>t=Test str区别