| Python Language Reference Manual by Guido van Rossum and Fred L. Drake, Jr. Paperback (6"x9"), 120 pages ISBN 0954161785 RRP £12.95 ($19.95) Sales of this book support the Python Software Foundation! Get a printed copy>>> |
5.11 Lambdas
lambda_form "lambda" [parameter_list]:expression
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,
def name(arguments):
return expression
See section 7.6 for the syntax of parameter lists. Note that functions created with lambda forms cannot contain statements.
| ISBN 0954161785 | Python Language Reference Manual | See the print edition |