explain this function to me, lambda confusion

Duncan Booth duncan.booth at invalid.invalid
Fri May 9 04:00:17 EDT 2008


andrej.panjkov at climatechange.qld.gov.au wrote:

> Indeed, there are many ways this could be done.  Some are more
> concise, some are more efficient.  As I said, I did it the way I did
> it to try out lambdas.  Your way achieves the result, rather elegantly
> I think, but teaches me nothing about using lambdas.

Unfortunately what you wrote taught you nothing about using lambda either. 
I think you were looking for it to have mystic powers, when in fact all it 
gives you is an alternative way to define a function.

> 
> Pardon my tetchiness, but it is a little hard to receive such blunt
> and inflexible replies to my posts.

It was blunt because your post was so wide of the mark, yet it was well 
written and at least at first glance sounded plausible. Other people had 
even followed up on minor points having apparently not spotted the bigger 
problem.

Remember that what you post here is going to be archived by Google and 
instructing (or misleading) people for years to come so jumping hard on 
factual errors is (I think) worthwhile. (And I really appreciate it every 
time other people have jumped on things I've got wrong.)

On the other hand, there are plenty of people who use lambda in situations 
which are more or less appropriate. Just how appropriate they are is 
usually a matter of opinion, and while I may express my opinion when I 
think they are misusing them, that's all it is: an opinion. Everyone is 
free to disagree (and generally does).



More information about the Python-list mailing list