gc.get_referrers(*objs)
Return the list of objects that directly refer to any of objs. This function will only locate those containers which support garbage collection; extension types which do refer to other objects but do not support garbage collection will not be found.
Note that objects which have already been dereferenced, but which live in cycles and have not yet been collected by the garbage collector can be listed among the resulting referrers. To get only currently live objects, call collect()
before calling get_referrers()
.
Care must be taken when using objects returned by get_referrers()
because some of them could still be under construction and hence in a temporarily invalid state. Avoid using get_referrers()
for any purpose other than debugging.
Please login to continue.