[Python-3000] Requiring () around lambda's argument list

Jim Jewett jimjjewett at gmail.com
Wed May 3 00:44:57 CEST 2006


On 5/1/06, Guido van Rossum <guido at python.org> wrote:
>... I'm settled on the following syntax for adding optional annotations

>   def foo(arg1name: typeexpr = defaultexpr, arg2: typeexpr =
> defaultexpr, ...): ...

Did you also decide that the annotations will have no effect by
themselves, and will rely on, for example, a decorator?...

>   lambda arg1name : ...

If something is worth decorating, it is worth naming.

If you even need to *document* restrictions on the argument (beyond
what you can get easily from the name or context), then the function
is a little too fancy for a lambda.

-jJ


More information about the Python-3000 mailing list