raghu wrote:
> Diez,
>
> I did look into gc, specifically gc.get_referrers(), but it seemed to
> give me something that I cant decipher.
>
> I added the following line.
>
> print "referrers ",gc.get_referrers(x0)
>
> This is what I got.
>
> referrers [{'__builtins__': ,
> '__file__': './tst1
Diez,
I did look into gc, specifically gc.get_referrers(), but it seemed to
give me something that I cant decipher.
I added the following line.
print "referrers ",gc.get_referrers(x0)
This is what I got.
referrers [{'__builtins__': ,
'__file__': './tst1.py', 'pdb': , 'sys':
, 'y': 24012, 'gc'
raghu wrote:
> 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 ",