Locking and try/finally
Erik Max Francis
max at alcyone.com
Wed Dec 4 00:40:57 EST 2002
xtian wrote:
> It seemed to me that, given the reference counting basis of Python GC,
> a class with a __del__ method would behave roughly the same:
This is a bad idea. Since __del__ is really a finalizer method, you've
no guarantee when (or even in some cases if) it'll be called. You
shouldn't rely on it being called in a timely manner in portable code,
particularly when relinquishing resources is involved.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ I never vote for anyone. I always vote against.
\__/ W.C. Fields
Blackgirl International / http://www.blackgirl.org/
The Internet resource for black women.
More information about the Python-list
mailing list