__del__ and reference count problem
Terry Reedy
tjreedy at udel.edu
Thu Apr 21 17:56:05 EDT 2005
"tiissa" <tiissa at nonfree.fr> wrote in message
news:4267f1e0$0$8871$636a15ce at news.free.fr...
> It's interesting to note that self.pop instead of A.pop works as
> expected.
> But I don't know why A.pop doesn't.
Because the name 'A' is no longer associated with the class object.
However, self has a reference to the class -- the .__class__ attribute.
Since self does not itself have a .pop attribute, the attribute resolution
code then looks at the class.
Terry J. Reedy
More information about the Python-list
mailing list