referrers

raghu raghavan.viswanathan at wipro.com
Wed May 24 05:40:46 EDT 2006


Hi All,

The sys.getrefcount() is very useful to get the number of references on
a particular object.

Is there any companion function to get "who" the referrers are ?

for e.g.

global x
global y
global z


x0=24012
y=x0
z=x0

print "ref count ",sys.getrefcount(x0)


This prints a ref count of 5.

Basically, I need to know which are the 5 entities who are referring to
x0 ?

Is there any way of doing it ?

Thanks.

Bye,
raghavan V




More information about the Python-list mailing list