repr函数和反引号用来获取对象的可打印的表示形式。你可以通过定义类的__repr__方法来控制你的对象在被repr函数调用的时候返回的内容。 在大多数时候有eval(repr(object)) == object。
repr函数和反引号用来获取对象的可打印的表示形式。你可以通过定义类的__repr__方法来控制你的对象在被repr函数调用的时候返回的内容。
repr
__repr__
在大多数时候有eval(repr(object)) == object。
eval(repr(object)) == object
Let's start Python programming!
哇哈哈哈!
感谢:沈洁元 Swaroop C. H.