[Python-ideas] For-loop variable scope: simultaneous possession and ingestion of cake

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Oct 4 01:08:13 CEST 2008


Aahz wrote:

> You'll need to make sure that exceptions don't break this.

Good point. I think that can be addressed by wrapping
the final value copying in a finally block. That will
ensure that the final value is always decoupled from
anything captured by a nested function.

-- 
Greg



More information about the Python-ideas mailing list