Python vs Java garbage collection?

Courageous jkraska at san.rr.com
Sun Dec 22 23:05:55 EST 2002


>Software tends to have a much longer lifetime and breadth than you first
>expect.  One day you may find yourself in a situation where you wish you
>hadn't been so short-sighted when you first wrote that code.

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. :)

C//




More information about the Python-list mailing list