destructors order not guaranteed?

William S. Lear rael at see.sig.com
Tue Oct 31 16:42:33 EST 2000


"Rainer Deyke" <root at rainerdeyke.com> writes:
> "William S. Lear" <rael at see.sig.com> wrote in message
> news:87snpduoxg.fsf at lisa.zopyra.com...
> > I don't see why it is not possible to "unwind" objects using a simple
> > stack of object pointers, but then I don't know the Python interpreter
> > internals.
> 
> You can explicitly control the lifetime of objects by using del.  You can
> also reference the objects through a utility object which defines __del__ to
> delete the objects it references in order (which can be automated).

Yes of course you can do it all explicitly and build all sorts of
contraptions to handle it for you, but this, to my mind, is a burden
the programmer should not have to bear.


Bill
-- 
William S. Lear | Who is there that sees not that this inextricable labyrinth
r a e l @       | of reasons  of state was artfully invented, lest the people
z o p y r a .   | should  understand  their own  affairs, and, understanding,
c o m           | become inclined to conduct them?    ---William Godwin, 1793



More information about the Python-list mailing list