Python vs Java garbage collection?
Isaac To
kkto at csis.hku.hk
Sun Dec 22 22:23:44 EST 2002
>>>>> "Erik" == Erik Max Francis <max at alcyone.com> writes:
Erik> The problem is that it _is_ sloppy programming, even within
Erik> Python. In _CPython_, you're pretty much guaranteed that the file
Erik> object will get reclaimed (and thus closed) rather quickly.
Erik> You've no such guarantee in other Python implementations, such as
Erik> Jython (where the __del__ method calling and reclaiming is done
Erik> with finalizers) and thus happens whenever the object gets garbage
Erik> collected, which may be soon after the statement executes or long
Erik> after.
What if C-Python is the only thing I used and care? And, you simply cannot
say that's broken if I have no way to test it (how about a flag of Python to
"disable garbage collection"? Then one can reasonably test whether he is
relying on the GC too much.).
Regards,
Isaac.
More information about the Python-list
mailing list