Python vs Java garbage collection?

"Martin v. Löwis" martin at v.loewis.de
Tue Dec 24 07:03:51 EST 2002


Bengt Richter wrote:
> E.g., suppose you had a suite-introducer whose purpose it was to define
> a local block of statements like try/finally but so that the compiler
> would automatically generate code so that all bindings created within
> the suite would be monitored and and immediately (i.e., maybe even
> during expression evaluation, but at least at the end of a statement)
> finalized when the equivalent of ref count going to zero happened. E.g.,
> 	autofinalize:
>             s = file('foo').read()

How would you implement this in Jython? In particular, what would be the 
equivalent of ref count, and how could you tell it goes to zero?

Regards,
Martin




More information about the Python-list mailing list