__del__ and reference count problem

Terry Reedy tjreedy at udel.edu
Thu Apr 21 17:52:27 EDT 2005


<ajikoe at gmail.com> wrote in message 
news:1114116099.446355.13610 at z14g2000cwz.googlegroups.com...
> it looks like we have to use other way, hold the data we want to
> preseve in an object, because it is possible the class is removed
> before the instance cleaned,

What is removed first is the binding between name A and the class object. 
But the class object still exists (its refcount is > 0) and can be accessed 
via the instance which has a reference to that class object.

Terry J. Reedy






More information about the Python-list mailing list