<div dir="ltr">Um, I think this is more complicated. Consider:<br><br> i = 0<br> def f():<br> i += 1<br> return lambda: i<br> <br>Now lambda: i is bound to i so every time I call f it will return a function that returns the current value of i not the one at the time f was called. So I can fix this by immanetization:<br>
<br> i = 0<br>
def f():<br>
i += 1<br>
return lambda: immanentize i<br>
<br>
This will return lambda: 1, then lambda: 2, etc. right? No. It returns lambda: 0, lambda: 0, etc.<br><br>--- Bruce<br><br><br></div>