On Friday 22 April 2005 06:44 pm, Scott David Daniels wrote: > Terry Hancock wrote: > > On Friday 22 April 2005 05:18 pm, [EMAIL PROTECTED] wrote: > > > > Perhaps you don't know how to call such functions? E.g.: > > a=[ lambda t: t**n for n in range(4) ] > >>>>a[2](3) > > 27 > > Didn't you notice this was a funny value?
Nope. Wasn't paying attention. ;-) Just copied the code from the OP. > Perhaps you mean: > a = [lambda t, n=n: t**n for n in range(4)] This is of course what he should've written, and/or what I should've corrected it to, thank you. Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/listinfo/python-list