AlternateLambdaSyntax - Python Wiki: "AlternateLambdaSyntax"
'via Blog this'
I must admit, I find the Python lambda syntax a bit unpleaasant:
lambda x: x+1It is a pity thaat Pythin's lambdaas are not multiline:
This seems to be aa consequence of Python not being indentation sensitive inside parens.
I think that it is also a pity that Python's lambdas are strictly anonymous - although you can assign them a named variable.
I personally often use lambdas not just for anonymous functions, but also for named functions that I want to define near point of use, in the narrowest scope possible.
Even if they could be a lambda, naming them gives nicer stack traces.