Steven D'Aprano wrote:
funcs = [(lambda x, i=j: x+i) for j in range(10)]

Now the reader is no longer distracted by the "i=i" ugliness.

   That's a good idea, in fact, change made!

The problem with Do What I Mean is that it so rarely Does What You Mean.
At best it Does What Some Other Guy Imagined I'd Probably Mean In This
Situation. Let's not go there.

Oh, I agree. This is one of those things where I agree (tongue-in-cheek) in all cases except the one I'm whining about! :)

 --just kidding, here.  Yes, ambiguous is bad.

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

Reply via email to