A replacement for lambda

Peter Hansen peter at engcorp.com
Sat Jul 30 23:53:05 CEST 2005


Paul Rubin wrote:
> How's this: f{args} (curly braces instead of parens) is the same as
> f(lambda: args).
> 
> Examples:
> 
>     launch_thread{targetfunc(a,b,c)}
>     b = Button{callback=pressed()}   # Button remembers callback()
>     sign_of_a = ternary{a < 0, -1, 1}

I'd consider this an interesting idea if it weren't for the fact that 
(at least with the fonts I generally use) I can barely make out the 
difference between the {} and the () above.

-Peter



More information about the Python-list mailing list