On Tue, Sep 25, 2012 at 12:17 PM, Oscar Benjamin <oscar.j.benja...@gmail.com> wrote: > Also I think lambda functions might be able to keep the frame alive. Are > they by any chance being created in a function that is called in a loop?
I'm pretty sure they don't. Closures don't keep a reference to the calling frame, only to the appropriate cellvars. Also note that whether a function is a closure has nothing to do with whether it was defined by a lambda or a def statement. In fact, there's no difference between functions created by one vs. the other, except that one has an interesting __name__ and the other does not. :-) -- http://mail.python.org/mailman/listinfo/python-list