Chris Angelico wrote: > On Wed, Apr 20, 2011 at 5:16 PM, Tim Roberts <t...@probo.com> wrote: >> You can solve this through the common lamba idiom of a closure: >> >> lst=filter(lambda x,posttype=posttype: x["type"].lower()==posttype,lst) > > Seems a little odd, but sure. I guess this means that a function's > default arguments are evaluated in the parent context, but the body is > evaluated in its own context?
The operation of calling a function has to evaluate arguments provided in the caller's namespace and assign them to variables in the called function's namespace. Yes. Mel. -- http://mail.python.org/mailman/listinfo/python-list