Lambdas

Syntax:

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(parameter list):
    return expression

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

 

A Django site. this page was rendered by a django application in 0.02s 2008-12-04 01:17:16.741685. hosted by webfaction.