Order of constructor/destructor invocation
Björn Lindberg
d95-bli.no at spam.nada.kth.se
Tue Mar 5 17:19:23 EST 2002
Jeremy Bowers wrote:
> non-interpreted languages don't specify it either. In fact, even IF
> C/C++ specifies the destructor order, which I don't care to look up
> right now, I would not be surprised that not all compilers will destruct
> in that order at the end of a function.
You're thinking of C++, and yes, the destructor order is well-defined,
and yes, all standards conformant compilers will follow this practice.
In fact, this is often used eg to manage resources.
I agree that the original approach doesn't look incredibly useful
though.
Björn
More information about the Python-list
mailing list