[Python-Dev] Object finalization for local (ie function) scopes
"Martin v. Löwis"
martin at v.loewis.de
Thu Jun 10 18:40:23 EDT 2004
Oliver Schoenborn wrote:
> I can accept that only if there is something inherent to the technique which
> exploits a non-specified aspect of the language. I can't think of any. Could
> you be more specific about what aspect is not portable?
The idea that you can execute code at the end of a function to invoke
teardown operations, even in the presence of exceptions. That cannot be
done for Jython, AFAIK. Jython generates Java byte code from Python
source code, so there is no Python virtual machine anywhere.
> If it is portable, then since it works as-is in Python, it could be put into
> the specs.
It doesn't work in Python. I believe your implementation also fails in
Jython (but didn't test).
More information about the Python-Dev