anonymous function with multiple statements

Terry Reedy tjreedy at udel.edu
Sun Jul 10 11:20:34 EDT 2011


On 7/10/2011 7:21 AM, Yingjie Lan wrote:

> I wonder if Python provides a way to define anonymous functions containing
> multiple statements?

No, intentionally not. Forget this idea. Multiple functions named 
'<lambda>' are inferior for representation purposes, like in error 
tracebacks, to those with individual names. Just use def statements.

Terry J. Reedy





More information about the Python-list mailing list