[Python-Dev] generalized resource alloc and de-alloc

Samuele Pedroni pedroni@inf.ethz.ch
Wed, 20 Mar 2002 01:57:35 +0100


From: Greg Ewing <greg@cosc.canterbury.ac.nz>
> Here's an even simpler version:
> 
>   with LHS = EXPR:
>     BODY
> 
> is equivalent to
> 
>   LHS = EXPR
>   try:
>     BODY
>   finally:
>     del LHS

It would not work in Jython as expected, because we have no
ref counting, and gc is not deterministic.
And I think in general that adding ref counting based
feature to Python as a language (not impl) is a bad idea.

regards.