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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4