¡@

Home 

python Programming Glossary: makeactions

How are closures implemented in Python?

http://stackoverflow.com/questions/3145893/how-are-closures-implemented-in-python

function exits all of its local references disappear. def makeActions acts for i in range 5 # Tries to remember each i acts.append.. lambda x i x # All remember same last i return acts makeActions n is the same for every n because the variable i is somehow.. up this variable Shouldn't it not exist at all because makeActions has already exited Why doesn't Python do what the code intuitively..