Multi-line lambda proposal.
Sybren Stuvel
sybrenUSE at YOURthirdtower.com.imagination
Wed May 10 04:55:56 EDT 2006
yairchu at gmail.com enlightened us with:
> multi-line lambdas, had it been added to python a long time ago,
> would had reduced a lot of complexity in the language. for example
> - with multi-line lambdas - decorators are unneccesary.
I love decorators.
> just give the multi-line lambda as an argument to a function - no
> need for special syntax..
Ehm... multi-line lamda /is/ a special syntax.
> the alternative decorators would also be simpler. currently when
> you want to create a "decorator-that-accepts-additional- arguments"
> you gotta make a funtion that gets those additional-arguments and
> returns a function that will be the decorator.
A bit tricky, but so far easier to understand than the multi-line
lambda tricks proposed. Sure, it's a function that returns a function
that returns a function, but still except for the @ it's syntactically
"just Python".
Sybren
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
More information about the Python-list
mailing list