Getting the reference count

Makhno mak at imakhno.freeserve.co.uk
Sun Aug 27 15:57:43 EDT 2000


>> Is it possible to get the reference count of a PyObject* object?
>> I'm sure it must be, but I can't see it documented anywhere.
>>
>> Something similar to Perl's SvREFCNT() Macro would be great.
>
>sys.getrefcount(object)

I'm sure there must be a better way than messing about importing modules and
deferencing attributes.
Presumably the reference count is stored inside the PyObject struct?






More information about the Python-list mailing list