[Python-ideas] Ruby-style Blocks in Python Idea
tav at espians.com
Mon Mar 9 16:33:30 CET 2009
> I believe this is just an extension to the lambda keyword. If lambdas could
> define a block, not just a statement, this would e.g. be
Multi-line lambdas would be nice, but I struggle to find a way to do
so in a Pythonic manner.
It would be nice to find a way though...
> tmp = lambda employee:
> if employee.salary > developer.salary:
You might as well just use ``def`` above...
> I see no reason for introducing two new keywords to do this, as you are
> really just enhancing the current lambda keyword.
I agree that two new keywords is a bit much. I tried to re-use
``with`` initially -- but I guess people would be confused by the
> On the other hand, turning blocks into anonymous functions would be very
> useful for functional programming. As such, I like your suggestion.
plex:espians/tav | tav at espians.com | +44 (0) 7809 569 369
http://tav.espians.com | http://twitter.com/tav | skype:tavespian
More information about the Python-ideas