syntactic sugar for def?

Terry Reedy tjreedy at udel.edu
Thu Sep 29 01:01:11 CEST 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