【发布时间】:2022-01-03 10:26:09
【问题描述】:
在 Python shell 中输入表达式会输出表达式的repr()。
是否可以将此默认功能设置为某些用户定义的功能?
【问题讨论】:
-
您是要更改对象的
repr()还是要更改shell 调用的实际函数? -
查看rjb's answer on this other question 以获得良好的实现。
标签: python customization read-eval-print-loop