Message222094
When repeated use of a nonlocal variable is made (e.g. to define multiple functions in a loop) ideally the closure should reflect the value of the local variable at the time of use. This should at least be explicitly documented if the behavior is considered not to be a bug.
The code sample attached shows that the closures produced operate differently inside and outside the enclosing function.
Without an explicit nonlocal declaration the closure should not be able to affect the nonlocal variable's value (which anyway hardly makes sense once the enclosing namespace has been destroyed), so I think it's possible to argue that this behavior is a bug, but I'd value comments from experienced developers. |
|
Date |
User |
Action |
Args |
2014-07-02 11:54:10 | holdenweb | set | recipients:
+ holdenweb |
2014-07-02 11:54:10 | holdenweb | set | messageid: <1404302050.04.0.0402916465626.issue21904@psf.upfronthosting.co.za> |
2014-07-02 11:54:09 | holdenweb | link | issue21904 messages |
2014-07-02 11:54:09 | holdenweb | create | |
|