如何停止python3打印每个命令后的引用计数

时间:2013-10-05 17:39:49

标签: python python-3.x

每个命令后python都会输出refs count。我想停止打印引用计数,我该怎么做?

示例:

>>> s = 'Hello World'
[786699 refs]
>>> str(s)
'Hello World'
[786699 refs]
>>> 

1 个答案:

答案 0 :(得分:5)

这不是标准行为:

$ python
Python 3.3.2 (default, May 21 2013, 11:50:47) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Running with pythonstartup.py
>>> s = 'Hello World'
>>> str(s)
'Hello World'
>>> 

您可能会这样做,因为您使用--with-pydebug配置了构建,如this post.

中所述