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

标签 python python-3.x

<分区>

在每个命令之后,python 打印 refs 计数。我想停止打印引用计数,我该怎么做?

例子:

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

最佳答案

这不是标准行为:

$ 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. 中所述。

关于python - 如何在每个命令后停止 python3 打印引用计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19200743/

相关文章:

python - 无法导入 pymongo ubuntu

python-3.x - 使用 Python 以编程方式从 Docker 容器内获取主机的 IP

python - 在 Python 中使用类根据用户输入打印出实例属性

python - 返回生成器而不是二维数组中的位置列表

python - 我的递归二分搜索程序出了什么问题?

python - 使用 matplotlib 和 numpy 绘制方程

python - 查找城市、州的县

python - Django模板中字典的循环问题

Python 正则表达式字符串到单词列表(包括带连字符的单词)

python - 从 String 在 python 中写入 TIFF 文件