A
Aahz
Objects with a __del__ method shall be reference counted. When the
reference count reaches zero, the __del__ method shall be called, and
any subobjects that have a __del__ method shall also be unreferenced.
The point at which the memory allocated to the object is freed is
largely irrelevant. The point is that there's a predictable time at
which __del__ is called. This is what enables the RAII idiom.
Now, this could be tricky to implement because we are now separating
the concepts of "destruction" and "finalization". But it's certainly
not impossible, and it would add a powerful new concept to the
language. So I don't think the idea should be rejected out of hand.
Is this clearer?
Problem is, that's exactly the situation we currently have in CPython, so
I don't see what the improvement is. Are you suggesting that Jython
change its semantics?