> The `i` is the problem.  It's not evaluated when the lambda *definition*
> is executed but when the lambda function is called.  And then `i` is
> always == `n`.  You have to explicitly bind it as default value in the
> lambda definition:
>
>               polys.append(lambda x, i=i: polys[i](x)*x)

Thank you for your help.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to