Python vs Java garbage collection?

Erik Max Francis max at alcyone.com
Sun Dec 22 23:40:18 EST 2002


Courageous wrote:

> I've only barely followed all this. But I'd say that, regardless of
> someone's intent to rely on gc from one environment to the next, one
> should explicitly call for the closure of files. Files are a resource
> that is external to Python, and can have an impact on other programs
> in the operating system. An explicit close is clear and helpful. This
> thinking can be generalized to other situations; for example, with
> sockets and so forth.
> 
> Hope this is on subject. :)

Yes, that's essentially exactly what I said a few posts ago:  "Even in
Python, you should make sure that code which acquires [external]
resources releases them in a timely manner."

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Take my advice:  Pull down your pants and slide on the ice.
\__/ Dr. Sidney Freedman
    Computer science / http://www.alcyone.com/max/reference/compsci/
 A computer science reference.



More information about the Python-list mailing list