Re: lambda closure question

2005-02-19 Thread Ted Lilley
I replied a few minutes ago thanking everyone for their pointers. Very interesting reading. I don't see my post yet, so I do hope it comes through. I'm using a new newsreading service and don't yet have confidence in it. In any case, the addition of the default-setting argument in the lambda wo

Re: lambda closure question

2005-02-19 Thread Ted Lilley
Wow, a lot of great discussion. Almost a bit too much for me to grasp...I do see two or more nuggets that really address my issue. As a side note, I'm familiar with the term currying from a friend who learned ML and Scheme quite some time ago. Not sure if that's the true origin, but it was a suf

lambda closure question

2005-02-18 Thread Ted Lilley
What I want to do is pre-load functions with arguments by iterating through a list like so: >>>class myclass: ...pass >>>def func(self, arg): ...print arg >>>mylist = ["my", "sample", "list"] >>>for item in mylist: ...setattr(myclass, item, lamdba self: func(self, item)) This attaches