Antoine> http://www.selenic.com/pipermail/mercurial-devel/2011-May/031055.html

From that note:

    1: You can't have meaningful destructors, because when destruction
    happens is undefined. And going-out-of-scope destructors are extremely
    useful. Python is already a rather broken in this regard, so feel free
    to ignore this point.

It's only broken if you regard RAII as the One True Way to
implement scoped resource management. Python has other approaches
to that, such as the with-statement.

Also, you *can* have destructors that work for objects in cycles,
as long as you don't insist on the destructor having access to
the object that's being destroyed. Weakref callbacks provide a
way of implementing this in CPython.

--
Greg
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to