Turn off python reference counter output

So, whenever I do something in Python, I keep getting this reference count. For example:

xxxxx@li282-82:~$ python
Python 2.7.3 (default, Feb 28 2013, 20:42:30) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
[40347 refs]
>>> django.VERSION
(1, 5, 2, 'final', 0)
[40349 refs]
>>> 
[40349 refs]
[19961 refs]
xxxxx@li282-82:~$ logout

How to disconnect it ?!

+4
source share
3 answers

It seems to me that your interpreter was compiled with a flag. To get rid of it, I think you will need to recompile.

+3
source

From Misc/SpecialBuilds.txt:

Py_REF_DEBUG


Turn on aggregate link counting. This arranges extern _Py_RefTotal hold the counter of all links, the amount of ob_refcnt for all objects. In debug-mode build, this is where "8288" comes from

>>> 23
23
[8288 refs]
>>>

, , , , , . , , "_" !

Py_REF_DEBUG decf, , refcount , , .

:

    sys.gettotalrefcount()
    Return current total of all refcounts.

Py_REF_DEBUG . : Python.

+2

@mgilson, , , Python ( /usr/local/bin/python). Python , , :

tar jxvf Python-x.y.z.tar.bz2
cd Python-x.y.z
./configure --prefix=/usr/local \
            --mandir=/usr/local/man \
            --enable-shared \
            --with-threads \
            --enable-ipv6 \
            --with-dbmliborder=gdbm
make
make install

: http://docs.python.org/2/using/unix.html#building-python

0

All Articles