5.11 Lambda形式(lambda表达式) Lambdas

Lambda forms (lambda expressions) have the same syntactic position as expressions. They are a shorthand to create anonymous functions; the expression lambda arguments: expression yields a function object. The unnamed object behaves like a function object defined with

Lambda形式(lambda表达式)在句法上与表达式有相同的位置. 这是一个创建类型函数的快捷方法;表达式lambda arguments: expression生成一个行为与下面定义的函数一致的函数对象:

def name(arguments):
    return expression

See section 7.5 for the syntax of parameter lists. Note that functions created with lambda forms cannot contain statements.