does python have useless destructors?
Aahz
aahz at pythoncraft.com
Sun Jun 13 23:41:36 EDT 2004
In article <n5mrp1-acm.ln1 at home.rogerbinns.com>,
Roger Binns <rogerb at rogerbinns.com> wrote:
>
>The whole problem that this thread is about is that Python has this
>bizarre scheme that an object will be garbage collected *unless* you
>add a __del__ method, at which point the docs imply you will be lucky
>for garbage collection to *ever* happen on the object.
Please keep the distinction between refcounting and GC clear. The
business with __del__ breaking memory management *only* occurs when you
need to use GC because you've got a cycle. Historically, Python didn't
have GC, and you had leaky memory whenever you had cycles. Now we've
got a much-improved situation.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"as long as we like the same operating system, things are cool." --piranha
More information about the Python-list
mailing list