Python vs Java garbage collection?

maney at pobox.com maney at pobox.com
Mon Dec 23 02:41:56 EST 2002


"Martin v. L?wis" <martin at v.loewis.de> wrote:
> Paul Foley wrote:
>> The "entire rationale behind garbage collection" is to present you
>> with the illusion that your computer has infinite memory.  If it
>> actually *had* infinite memory, garbage collection would be a no-op.
>> Where would your finalizers be then?
> 
> People often extend this rationale to "your computer has infinite 
> resources". Closing a file is then not necessary since you can have as 
> many open files as you want to, and finalizers wouldn't be needed for that.

However, this sort argument won't get you very far when the external
resource is something like a write lock on a shared data store!



More information about the Python-list mailing list