syntactic sugar for def?

Terry Reedy tjreedy at
Wed Sep 28 19:01:11 EDT 2011

On 9/28/2011 5:26 PM, Ethan Furman wrote:

> I don't remember if 'def' is sugar for something besides lambda.

That is a bit backwards.
   lambda x: expr(x)
is syntactic sugar for
   def <lambda>(x): return expr(x)
   del <lambda>

Terry Jan Reedy

More information about the Python-list mailing list