str.py中去掉repr=str ,程序还是可正常运行 拿这一行的作用是什么
看了后面忘了前面吗
__repr()是为调试服务的 如果没有__repr() = __str__ 在交互式环境下打印的结果就又变成:
<__main__.Student object at 0x109afb190>
Sign in to make a reply
反煽情会长门下门徒
str.py中去掉repr=str ,程序还是可正常运行 拿这一行的作用是什么