Diez B. Roggisch wrote:
> It's a FAQ. The reason is that the created closures don't capture the > _value_, but the _name_. Plus of course the locals()-dictionary outside > the function a to perform the lookup of that name. Which has the value > bound to it in the last iteration. > > Common cure for this is to create an a-local name that shadows the outer > variable and is simultaneously bound to the desired value: Many thanks (also to JP) for the clear explanation. Greatly appreciated. Cheers, f -- http://mail.python.org/mailman/listinfo/python-list