Destructor never called ???

Alex Martelli aleax at aleax.it
Fri Sep 20 05:15:26 EDT 2002


Tim Peters wrote:
        ...
> __del__s will be invoked.  It's only the cases where Python can't possibly
> guess a safe order in which to call destructors where both __del__ and
> collection are inhibited.

I think it's a bit more than that: Python *COULD" "possibly guess a
safe order" when there is only exactly ONE object with a __del__ that
is part of the cycle -- namely, destroy that one object first.  It
doesn't seem to even TRY (note: I'm not saying it SHOULD -- but
"can't possibly" might be a bit too strong as a description of what
is actually going on).


Alex




More information about the Python-list mailing list