IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
5.11 Lambdas


5.11 Lambdas

Download entire grammar as text.

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.

See About this document... for information on suggesting changes.