I\'m curious about the difference between lambda function and a regular function (defined with def) - in the python level. (I know what is the diff
The only difference is that (a) the body of a lambda can consist of only a single expression, the result of which is returned from the function created and (b) a lambda expression is an expression which evaluates to a function object, while a def statement has no value, and creates a function object and binds it to a name.
In all other material respects they result in identical objects - the same scope and capture rules apply. (Immaterial differences are that lambda-created functions have a default func_name of ". This may affect operation in esoteric cases - e.g. attempts to pickle functions.).