[issue13094] Need Programming FAQ entry for the behavior of closures

2011-10-03 Thread Tomáš Dvořák
Tomáš Dvořák added the comment: Thank you all very much for the super-quick responses. I'm used to smalltalk, so the python variable binding behaviour is unnatural to me, but I guess there must have been some reasons for making it behave this way. Ezio, the "lambda each=each: ea

[issue13094] setattr misbehaves when used with lambdas inside for loop

2011-10-03 Thread Tomáš Dvořák
New submission from Tomáš Dvořák : I have this python script, and run it in python 2.7.2 (installed from EPD_free 7.1-2 (32-bit), but I guess this has nothing to do with EPD. 8<---fail.py-- class X(object): pass x = X() items = ["foo", "bar", "baz"