[Python-ideas] Syntax for passing lambdas to functions

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 27 23:21:12 CET 2014


Steven D'Aprano wrote:
> All it buys you is saving *one line* 
> per assignment:
> 
>     def spam():
>         ...
>     functions[0] = spam

The motivation isn't to save a line, it's to make the
code clearer, like the way decorators make the use of
staticmethod and classmethod clearer.

-- 
Greg


More information about the Python-ideas mailing list