Something is rotten in Denmark...
harrismh777
harrismh777 at charter.net
Thu Jun 2 11:44:00 EDT 2011
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.
More information about the Python-list
mailing list