>>> monomials = [lambda x: x(star)(star)i for i in [1,2,3]] #(not sure how to escape stars for exponentiation properly, whatever)
OK, what will these functions evaluate to at the point 2.0?
>>> monomials(2.0), monomials(2.0), monomials(2.0)
(8.0, 8.0, 8.0)
The i variable was captured as an address which all the lambdas share. For an integer. Ouch.
You can do "lambda x,i=i: x(star)(star)i" and capture the value properly, but to me this is a landmine waiting to be stumbled upon every time I write a lambda. I for one will often forget to do this, at least so long as I also keep using other languages which can capture integers as values without hijinks.
If you want to capture values, that's easy too, with:
lambda x, i=i: ...